Hi
When making a custom inspector I can see reference for entering ints and strings etc but not arrays. Is there no build-in command for this so as to create the same thing you would have got by default just having an exposed array in the original script? Or do you have to invent one?
Cheers
in C#:
int[] arr = new int[5]{10,34,25,29,7};
you can also use an ExecuteInEditMode flag to run code in edit mode (like OnEnable( ) which should be called the first time a behavior is applied to an object and when it is toggled as enabled/disabled n’ what not)
you could also use an Editor script (Editor Class) to make a custom editor for that particular behavior to help with initial variable assignment if its more complicated. Read up on the CustomEditor stuff in the docs.
OK I’ll be more specific,
I have a script and I need to write a custom editor script to go with it. When you do this the accessible variables that were there by default disappear so as well as adding new options I would like to replace the array that was accessible. In the docs I can find examples like:
myPlayer.speed = EditorGUILayout.Slider(myPlayer.speed, 0.0, 100.0); or
myPlayer.ammo = EditorGUILayout.IntField(myPlayer.ammo);
for sliders and ints etc. However is there a built in function for setting up an array similar to what was there by default?