In c# is it possible to declare a public variable but not have it show up in the inspector?
I want to do this for public variables that will be set by external scripts and have no need to be in the inspector so I don’t want the inspector to be cluttered by them.
public class QuickExample : MonoBehavior
{
public float MemberVariable; // this shows up in the inspector
public float Property { get; set; } // this doesn't show up in the inspector
}
Other code can refer to properties in a manner very similar to accessing public variables.
QuickExample test = new QuickExample();
test.MemberVariable = 5;
test.Property = 6;
Debug.Log(test.MemberVariable); // logs "5"
Debug.Log(test.Property); // logs "6"