Question by
recaigeciken14 · May 04, 2021 at 09:36 PM ·
listclasscustom classimplementation
Custom class list seen as "none" in inspector.
As shown below, i've made all the implementation as far as i know and it seen as none in the inspector when run the game.
public class item_database : MonoBehaviou![alt text][1]r
{
public Sprite[] spriteboxes;
public List<item> items;
void Start()
{
items = new List<item>();
set_database();
}
void set_database()
{
items.Add(new item(item.itemType.food, 0, "carrot", "garden food", spriteboxes[0]));
items.Add(new item(item.itemType.food, 1, "red mushroom", "wild food",spriteboxes[1]));
items.Add(new item(item.itemType.food, 2, "mushroom", "wild food", spriteboxes[2]));
}
}
[1]: /storage/temp/180253-screenshot-3.png
screenshot-3.png
(12.0 kB)
Comment
Best Answer
Answer by recaigeciken14 · May 04, 2021 at 09:49 PM
I fixed the issue, just remove the monobehabiour inheritance from item class (custom class one)