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(); } }; }); }
public static UICommandLabelButton Instantiate(UICommandLabelButton prefab, Transform parent, Vector3 pos, int nIndex, BattleCommand iCommand, Func <bool> onSetCommand) { UICommandLabelButton uICommandLabelButton = UnityEngine.Object.Instantiate(prefab); uICommandLabelButton.transform.parent = parent; uICommandLabelButton.transform.localScaleOne(); uICommandLabelButton.transform.localPosition = pos; uICommandLabelButton.Init(nIndex, isValid: true, iCommand, onSetCommand); return(uICommandLabelButton); }
public static UICommandLabelButton Instantiate(UICommandLabelButton prefab, Transform parent, Vector3 pos, int nIndex, BattleCommand iCommand, Func <bool> onSetCommand) { UICommandLabelButton uICommandLabelButton = Object.Instantiate <UICommandLabelButton>(prefab); uICommandLabelButton.get_transform().set_parent(parent); uICommandLabelButton.get_transform().localScaleOne(); uICommandLabelButton.get_transform().set_localPosition(pos); uICommandLabelButton.Init(nIndex, true, iCommand, onSetCommand); return(uICommandLabelButton); }
private void OnSelectedSurface(UICommandLabelButton selectedButton) { this._clsState.Clear(); this._isInputPossible = false; BattleCommand iCommand = (!this._listInvalidCommands.Contains(selectedButton.battleCommand)) ? selectedButton.battleCommand : BattleCommand.Sekkin; this._uiCommandUnitSelect.Show(iCommand, delegate { this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitUnitSelect), new StatementMachine.StatementMachineUpdate(this.UpdateUnitSelect)); }); }
private void OnSelectedSurface(UICommandLabelButton selectedButton) { _clsState.Clear(); _isInputPossible = false; BattleCommand iCommand = (!_listInvalidCommands.Contains(selectedButton.battleCommand)) ? selectedButton.battleCommand : BattleCommand.Sekkin; _uiCommandUnitSelect.Show(iCommand, delegate { _clsState.AddState(InitUnitSelect, UpdateUnitSelect); }); }
private void OnSelectSurface(UICommandLabelButton selectedSurface) { Dlg.Call(ref _actOnSelectedSurface, selectedSurface); }