Hello,
in my project, I have this in my DialogManager.cs :
[System.Serializable]
public class DialogNode {
public int id;
public string text;
public List<Option> options;
}
and this:
[System.Serializable]
public class Option{
public string text;
public int link;
}
Now I want to create an Array of these DialogNode:
public DialogNode dialogs;
So far, so good. This works perfectly and I can edit the size of this Array in the inscpector.
BUT: I want to define a size of this array in
void Start(){
dialogs = new DialogNode[5]; // Error occurs here
}
NullReferenceException: Object reference not set to an instance of an object
I know, WHY this error occurs, but I have no solution to fix it.
For interested parties:
I created a DialogManager and parsing a XML-File to my Array of DialogNodes.
But I want a fix size of my Array.
Can anybody please give a hint?
Greetings,
V4mpy