I have 2 c# script, NPCManager and NPCs.
NPCManager.cs
using UnityEngine;
using System.Collections;
public class NPCManager : MonoBehaviour {
public int npcID;
public int npcStage;
public string npcName;
public string npcDialog;
public NPCManager(int ID, int Stage, string Name, string Dialog)
{
npcID = ID;
npcStage = Stage;
npcName = Name;
npcDialog = Dialog;
}
}
the NPCs.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class NPCs : MonoBehaviour {
public List<NPCManager> NPCList = new List<NPCManager>();
void Start () {
NPCList.Add( new NPCManager(1, 0, "test", "test" ) );
}
}
there is no error, no warning.
in the inspector which NPCs added, when i start the game the list added 1 size but it say “None (NPCManager)”.
i want it show the NPCManager variable.