Let's say I have a variable named button of type Button which is of course System.Serializable.
I want that variable to be assignable through the inspector, so I make it public:
public class SomeScript : MonoBehaviour{
public Button button;
}
Which gives me that:
Now, I want to keep the code clean & secure (organized) and there's a real reason why I need to preserve the encapsulation.
I know that there are multiple ways of retrieving components on runtime like transform.Find("Some/Genius/TypeUnsafe/Path") or GameObject.Find("3 seconds scene iteration").GetComponent(...). I want to avoid that.
How do I mix a variable private access with it's public access in the inspector?
