public static BattleFormationKinds1[] GetFormationArray(DeckModel deck) { HashSet <BattleFormationKinds1> selectableFormations = DeckUtil.GetSelectableFormations(deck); List <BattleFormationKinds1> list = new List <BattleFormationKinds1>(); if (selectableFormations.Contains(BattleFormationKinds1.TanJuu)) { list.Add(BattleFormationKinds1.TanJuu); } if (selectableFormations.Contains(BattleFormationKinds1.FukuJuu)) { list.Add(BattleFormationKinds1.FukuJuu); } if (selectableFormations.Contains(BattleFormationKinds1.Rinkei)) { list.Add(BattleFormationKinds1.Rinkei); } if (selectableFormations.Contains(BattleFormationKinds1.Teikei)) { list.Add(BattleFormationKinds1.Teikei); } if (selectableFormations.Contains(BattleFormationKinds1.TanOu)) { list.Add(BattleFormationKinds1.TanOu); } return(list.ToArray()); }
private void Init(DeckModel model) { this._clsDeckModel = model; this._isInputPossible = false; this._iSelectFormation = BattleFormationKinds1.TanJuu; this.panel.alpha = 0f; this._clsBrightPoints.Init(); HashSet <BattleFormationKinds1> hash = DeckUtil.GetSelectableFormations(this._clsDeckModel); BattleFormationKinds1 cnt = BattleFormationKinds1.TanJuu; this._listLabelButton.ForEach(delegate(UILabelButton x) { x.Init((int)cnt, hash.Contains(cnt)); x.isFocus = false; x.toggle.group = 1; x.toggle.set_enabled(false); x.toggle.onDecide = delegate { this.DecideFormation((BattleFormationKinds1)x.index); }; x.toggle.onActive = Util.CreateEventDelegateList(this, "OnActive", cnt); if (x.index == 1) { x.isFocus = (x.toggle.startsActive = true); } cnt++; }); }
private void OnPushStateFormationSelect() { HashSet <BattleFormationKinds1> selectableFormations = DeckUtil.GetSelectableFormations(mBattlePracticeContext.FriendDeck); BattleFormationKinds1[] array = (from w in selectableFormations where true select w).ToArray(); mPracticeBattleTargetSelect.SetActive(isActive: false); mPracticeMenu.SetActive(isActive: false); if (1 < array.Count()) { GameObject gameObject = GameObject.Find("Live2DRender"); if (gameObject != null) { UIPanel component = gameObject.GetComponent <UIPanel>(); if (component != null) { component.depth = 6; } } UIBattleFormationKindSelectManager battleFormationKindSelectManager = Util.Instantiate(mPrefab_UIBattleFormationKindSelectManager.gameObject, base.transform.gameObject).GetComponent <UIBattleFormationKindSelectManager>(); battleFormationKindSelectManager.Initialize(mCamera_CatchTouchEvent, array, manualUpdate: true); battleFormationKindSelectManager.SetOnUIBattleFormationKindSelectManagerAction(delegate(UIBattleFormationKindSelectManager.ActionType actionType, UIBattleFormationKindSelectManager calledObject, UIBattleFormationKind centerView) { int width2 = StrategyTopTaskManager.Instance.UIModel.Character.GetWidth(); int num2 = -960 - Mathf.Abs(width2) / 2; StrategyTopTaskManager.Instance.UIModel.Character.moveAddCharacterX(num2, 1f, null); BattleFormationKinds1 category = centerView.Category; mBattlePracticeContext.SetFormationType(category); mStateManager.PopState(); mStateManager.PushState(State.BattlePracticeProd); UnityEngine.Object.Destroy(battleFormationKindSelectManager.gameObject); }); mKeyController.ClearKeyAll(); mKeyController.firstUpdate = true; battleFormationKindSelectManager.SetKeyController(mKeyController); } else { int width = StrategyTopTaskManager.Instance.UIModel.Character.GetWidth(); int num = -960 - Mathf.Abs(width) / 2; StrategyTopTaskManager.Instance.UIModel.Character.moveAddCharacterX(num, 1f, null); mBattlePracticeContext.SetFormationType(BattleFormationKinds1.TanJuu); mStateManager.PopState(); mStateManager.PushState(State.BattlePracticeProd); } }
public void Initialize(DeckModel deck) { mSelectableFormations = DeckUtil.GetSelectableFormations(deck); mVector3DefaultPosition = new Vector3[mSprites_Formations.Length]; mVector3DefaultScale = new Vector3[mSprites_Formations.Length]; int num = 0; UISprite[] array = mSprites_Formations; foreach (UISprite uISprite in array) { uISprite.alpha = 0.01f; mVector3DefaultPosition[num] = uISprite.transform.localPosition; mVector3DefaultScale[num] = uISprite.transform.localScale; uISprite.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f); num++; } ChangeFocusIndex(0); }
public void Initialize(DeckModel deck) { this.mSelectableFormations = DeckUtil.GetSelectableFormations(deck); this.mVector3DefaultPosition = new Vector3[this.mSprites_Formations.Length]; this.mVector3DefaultScale = new Vector3[this.mSprites_Formations.Length]; int num = 0; UISprite[] array = this.mSprites_Formations; for (int i = 0; i < array.Length; i++) { UISprite uISprite = array[i]; uISprite.alpha = 0.01f; this.mVector3DefaultPosition[num] = uISprite.get_transform().get_localPosition(); this.mVector3DefaultScale[num] = uISprite.get_transform().get_localScale(); uISprite.get_transform().set_localScale(new Vector3(0.01f, 0.01f, 0.01f)); num++; } this.ChangeFocusIndex(0); }