- Home /
How do I make a public class show in the inspector?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ArrayTwo : MonoBehaviour
{
[System.Serializable]
public class item
{
public int itemID;
public string name;
public string description;
}
Even though I used [System.Serializable] I still see nothing in the inspector, anyone know the issue?
Comment
Best Answer
Answer by BradyIrv · Jun 12, 2020 at 06:27 AM
You've made the class, but no reference to it to be drawn in the inspector. Inside ArrayTwo create the variable for class item and it will show in inspector.
public item myItem;
Alternatively, declare it as it's own class as mentioned above instead of being inside ArrayTwo
Thanks, I made public item myItem
inside ArrayTwo. Works perfectly appreciate it!