private void CreateCommandLabel(List <BattleCommand> presetList) { int num = 0; foreach (BattleCommand preset in presetList) { _listISelectSurface.Add(UICommandLabelButton.Instantiate(((Component)_prefabUILabelButton).GetComponent <UICommandLabelButton>(), _uiSurfaceAnchor.transform, Vector3.zero, num, preset, CheckBattleStartState)); _listISelectSurface[num].toggle.transform.localPosition = Vector3.down * (50 * num); num++; } UILabelButton battleStart = _strFrame.battleStart; battleStart.Init(presetList.Count, isValid: false, KCVColor.ConvertColor(170f, 170f, 170f, 255f), KCVColor.ConvertColor(170f, 170f, 170f, 128f)); _listISelectSurface.Add(battleStart); _listISelectSurface.ForEach(delegate(ISelectedObject <int> x) { UICommandSurfaceList uICommandSurfaceList = this; x.toggle.group = 15; x.toggle.onActive = Util.CreateEventDelegateList(this, "OnActive", x.index); x.toggle.onDecide = delegate { if (x is UICommandLabelButton) { uICommandSurfaceList.OnSelectSurface(x as UICommandLabelButton); } else { uICommandSurfaceList.OnSelectBattleStart(); } }; }); }
private void CreateCommandLabel(List <BattleCommand> presetList) { int num = 0; using (List <BattleCommand> .Enumerator enumerator = presetList.GetEnumerator()) { while (enumerator.MoveNext()) { BattleCommand current = enumerator.get_Current(); this._listISelectSurface.Add(UICommandLabelButton.Instantiate(this._prefabUILabelButton.GetComponent <UICommandLabelButton>(), this._uiSurfaceAnchor.get_transform(), Vector3.get_zero(), num, current, new Func <bool>(this.CheckBattleStartState))); this._listISelectSurface.get_Item(num).toggle.get_transform().set_localPosition(Vector3.get_down() * (float)(50 * num)); num++; } } UILabelButton battleStart = this._strFrame.battleStart; battleStart.Init(presetList.get_Count(), false, KCVColor.ConvertColor(170f, 170f, 170f, 255f), KCVColor.ConvertColor(170f, 170f, 170f, 128f)); this._listISelectSurface.Add(battleStart); this._listISelectSurface.ForEach(delegate(ISelectedObject <int> x) { x.toggle.group = 15; x.toggle.onActive = Util.CreateEventDelegateList(this, "OnActive", x.index); x.toggle.onDecide = delegate { if (x is UICommandLabelButton) { this.OnSelectSurface(x as UICommandLabelButton); } else { this.OnSelectBattleStart(); } }; }); }