Hi
I’m writing a C# script, and nested classes/structs are not showing up there.
I’ll explain in code.
This javascript code (NestedClassJS.js) :
class TestNested
{
var a : int = 1;
};
var nestedInstance : TestNested;
function Update () {
}
Causes ‘nestedInstance’ to appear in the inspector tab when the script is applied to a gameobject.
However, this C# code (NestedClassCS.cs) :
using UnityEngine;
public class TestNestedCS
{
int B;
};
public class NestedClassCS : MonoBehaviour {
public TestNestedCS testNestedInstance;
// Update is called once per frame
void Update () {
}
}
Does not. I tried using structs instead of classes, placing the nested class inside and outside the class definition and still nothing.
Does anyone know what I need to do to get the nested instance to appear in the inspector?
Thanks!