|
I am trying to create an array to hold something but it is not appearing in the inspector so I cannot populate it, I could do it with code but for a reason that is unknown to me I cannot simply drag the things I want to populate the array with into it from the hierarchy like I usually can
anything wrong with that that would cause it to not show up in the inspector? MenuItem is the class I want to populate my array with
(comments are locked)
|
|
Nevermind It turns out my prefab for my menu items was named the same as the script and unity apparently hates that.. I had to change the name of my script to lower case letters and then change that line to use Don't name a variable in PascalCase or a class in camelCase. Pick a name that hasn't already been used. Having a variable be the same name as a class is not good practice. If you want to be able to access an object like an array, you can use indexers, though. http://msdn.microsoft.com/en-us/library/2549tw02.aspx (There is no way to work with these in UnityScript, as far as I know.) Unity's Vector2/3/4 and Color, for example, use indexers.
Feb 21 '11 at 12:16 PM
Jessy
(comments are locked)
|

MenuItem is a custom Attribute-class for editor scripts. I guess that was the problem. http://unity3d.com/support/documentation/ScriptReference/MenuItem.html