I used to code in JS (with Unity at least) and I recently decided to go for C#. In JS, when you create a class and use it in a monobehaviour, it's shown in the inspector, with a little arrow to unfold, but apparently not in C#. The code below explain the matter :
JS code (I can see "classVar" in the inspector, and "varNotHidden" within it)
class SecondClass
{
var varNotHidden : int = 0;
@HideInInspector
var varHidden : int = 0;
}
class MainClass extends MonoBehaviour
{
var classVar : SecondClass;
}
C# code (I can't see "classVar" in the inspector)
using UnityEngine;
public class SecondClass
{
public int varNotHidden = 0;
[HideInInspector]
public int varHidden = 0;
}
public class MainClass : MonoBehaviour
{
public SecondClass classVar;
}
So I wonder why "classVar" remain invisible in C#. Both variable and class are public, I'm not using [HideInInspector] for it. I'm kind of lost ...
Is there something like [PrettyPleaseDontHideInInspector] ? I really hope I don't have to use a CustomEditor for each class ...