关于动态赋值对象的问题
17 private GameObject[][] btnArr = new GameObject[4][];30 GameObject a = bg.transform.Find("LeftPanel/Column_" + j + "/Button_" + i + "_" + j).gameObject;
31 btnArr[i][j] = bg.transform.Find("LeftPanel/Column_" + j + "/Button_" + i + "_" + j).gameObject;
调试断点 发现给a赋值的时候 运行正常 数据也对的 但是给数组赋值的时候就报错了:
NullReferenceException: Object reference not set to an instance of an object
(wrapper stelemref) object:stelemref (object,intptr,object)
GameControl.initMap () (at Assets/Script/GameControl.cs:31)
GameControl.Start () (at Assets/Script/GameControl.cs:91)