So I’m trying to put an object into this dictionary, the code will compile without errors but as soon as i run it the line in void Start() will give the following error:
NullReferenceException: Object reference not set to an instance of an object ButtonInit.Start () (at Assets/Scripts/ButtonInit.cs:25)
public static Dictionary<int, object> page;
private void Start()
{
page.Add(1, FuncPG01());
}
public object FuncPG01()
{
Debug.Log("i got here");
// do some important stuff here
return 1;
}