Answer the question
In order to leave comments, you need to log in
Why can't I use another class dictionary?
here i have a class
public class InfoTest : MonoBehaviour{
public Dictionary<string, string> ArrayInfo = new Dictionary<string, string>();
public static InfoTest instance;
private void Awake(){
instance = this;
ArrayInfo.Add("Test1", "..........................");
ArrayInfo.Add("Test2", "..........................");
...................
private void Test(){
foreach(KeyValuePair<string, string> kv in InfoTest.instance.ArrayInfo){
..........................
NullReferenceException: Object reference not set to an instance of an object
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question