- Home /
C# - public variable not exposed to the Project Panel? (n00b to c#)
I have been working in Unity using Javascript for about a month, but now that I am using SmartFox with Unity I am finding it a requirement to switch to C#. I cannot seem to find a way to make a variable declaration that is "public" (ie. accessible to other scripts) but is not exposed to the Project Panel (I don't want 20 unneccessary variables listed on my GameObject in the panel). How can I do this if the variable is going to be dynamic (I tried static variables but can't seem to change them, which makes sense in hindsight). From what I understand, simply declaring the variable makes it private by default, and setting it to private seems to always expose it to the Project Panel, which I definitely do not need.
Sorry for the n00b level of my question, but the conversion is a bit overwhelming at this juncture (especially since I wasn't that skilled with Unity's Javascript to begin with).
Thanks in advance!
Answer by Peter G · Nov 04, 2011 at 10:31 PM
Put the attribute:
[HideInInspector]
before the public variable declaration.