﻿using UnityEditor;

namespace BitStrap
{
	public class ScriptableObjectContextMenu
	{
		[MenuItem("CONTEXT/ScriptableObject/Select in Project View")]
		public static void SelectScriptabelObject(MenuCommand menuCommand)
		{
			EditorGUIUtility.PingObject(menuCommand.context);
		}
	}
}
﻿using UnityEditor;
using UnityEngine;

namespace BitStrap
{
	public class ScriptableObjectContextMenu
	{
		[MenuItem("CONTEXT/ScriptableObject/Select Script", false, 10)]
		public static void SelectScriptabelObjectScript(MenuCommand menuCommand)
		{
			var serializedObject = new SerializedObject(menuCommand.context);
			var scriptProperty = serializedObject.FindProperty("m_Script");
			var scriptObject = scriptProperty.objectReferenceValue;
			Selection.activeObject = scriptObject;
		}

		[MenuItem("CONTEXT/ScriptableObject/Show in Project View")]
		public static void SelectScriptabelObject(MenuCommand menuCommand)
		{
			EditorGUIUtility.PingObject(menuCommand.context);
		}
	}
}
Add context menu to select the script of a scriptable object
Add context menu to select the script of a scriptable object
