I know that I, for a class to show up in the Inspector, have to add [System.Serializable] to the class, but this does not work. What am I doing wrong here or is this feature only available in the Pro Version of Unity because I only got the free one.
public class TestingScript : MonoBehaviour {
public float testFloat;
void Start () {
}
}
[System.Serializable]
public class Foo
{
public string testString; // Does not show up, not even the class "Foo"
}
No, it is available in free version as well as in pro.
Your code looks well and absolutelly correct for showing in the inspector panel. But do not forget marks private variables with [SerializeField] attribute. But as I know public variable should be shown in Inpector panel even if they has not this attribute.
In any case try to add this attribute:
public class TestingScript : MonoBehaviour {
[SerializeField]
public float testFloat;
void Start () {
}
}
[System.Serializable]
public class Foo
{
[SerializeField]
public string testString; // Does not show up, not even the class "Foo"
}