I am a MegaNoob on this front…
I am trying to use an example editor script, to get on my feet, and understand the concept…
@CustomEditor(MyPlayerEditor)
class MyPlayerEditor extends Editor
{
function OnInspectorGUI()
{
EditorGUILayout.BeginHorizontal ();
EditorGUILayout.PrefixLabel ("Speed");
target.speed = EditorGUILayout.Slider (target.speed, 0, 100);
EditorGUILayout.EndHorizontal ();
EditorGUILayout.BeginHorizontal ();
EditorGUILayout.PrefixLabel ("Ammo");
target.ammo = EditorGUILayout.IntField (target.ammo);
EditorGUILayout.EndHorizontal ();
}
}
Apparently this code is supposed to be a custom inspector - but I can’t find the inspector anywhere! If I understand correctly, it is supposed to display in a manner similar to the Game View, Hierarchy, Inspector, etcetera. However, as I have said, I can’t find it anywhere to display in the first place! I have made sure it is under the “Editor” folder.
Any help?