I defined the following public member variable in JavaScript…
var Bounds : Rect;
but it does not show up in the inspector. What types can or cannot be exposed in the Inspector?
Thank you.
I defined the following public member variable in JavaScript…
var Bounds : Rect;
but it does not show up in the inspector. What types can or cannot be exposed in the Inspector?
Thank you.
You can only expose primitive data types, I believe. What are you trying to do? Would it not work to just expose some of the object variables like Rect.width and Rect.height?
Thanks for your reply Marble. I would like to expose a Rect object in the inspector, much like a view port is exposed from the Camera component, or pixel inset is exposed from the GUITexture component. This is a more convenient use of code and Inspector real estate than exposing each Rect member.
Since it appears that I can’t, I will take your suggestion and expose the individual elements.
However, my question is more general. Atomic types can be exposed, as can classes inherting from Object, I think. But rather than experimenting or guessing, I was hoping that someone who knew could simply state exactly what can and cannot be exposed.
Thanks again, Marble, for your advice.
Rect should show up in the inspector, it’s just an (already reported) bug that it doesn’t. More than just atomic variables show up in the inspector. (Vector3, Quaternion, etc) If you need a Rect in your script, you can always write your own Rect class and have that show up in the inspector. Just stick the [System.Serializable] attribute on the class.
Like is done in the C# example of this: http://unify.bluegillweb.com/scriptwiki/index.php?title=Button