public override void Awake() { base.Awake(); childDatas = new ChildData[Main.settings.numberOfColumns]; for (int i = 0; i < Main.settings.numberOfColumns; i++) { Transform child = transform.GetChild(i); childDatas[i] = new ChildData(child); } }
private void SetCell(ItemCell itemCell, int index) { ActorItem item = itemCell as ActorItem; if (item == null) { // Main.Logger.Log("ItemCell 出错。。。"); return; } item.name = "Actor,10000"; //item.GetComponent<Image>().color = new Color(index%2 == 0 ? 1:0, 0, 0); string[] names = new string[item.childDatas.Length]; ChildData[] childDatas = item.childDatas; for (int i = 0; i < Main.settings.numberOfColumns; i++) { if (i < childDatas.Length) { int idx = (index - 1) * Main.settings.numberOfColumns + i; ChildData childData = childDatas[i]; if (idx < m_data.Length) { int num2 = m_data[idx]; GameObject go = childData.gameObject; go.name = "Actor," + num2; childData.toggle.group = HomeSystem.instance.listActorsHolder.GetComponent <ToggleGroup>(); childData.setItem.SetActor(num2, skillTyp, favorChange); names[i] = "\nActor," + num2 + " 多余的隐藏 第" + index + "行 第" + i + "个 索引=" + idx; if (!go.activeSelf) { go.SetActive(true); } } else { GameObject go = childData.gameObject; if (go.activeSelf) { go.SetActive(false); } // Main.Logger.Log("多余的隐藏 第" + index + "行 第" + i + "个 索引=" + idx); } } else { // Main.Logger.Log("行数量出错。。。"); } } // Main.Logger.Log(string.Format("创建第{0}行NPC {1} {2} {3} {4}", index, names[0], names[1], names[2], names[3])); }