示例#1
0
 private bool Init(CommandPhaseModel model)
 {
     this._listInvalidCommands = this.GetInvalidCommands(model.GetSelectableCommands());
     this._clsCommandModel     = model;
     this._iInputMode          = InputMode.Key;
     this._uiCommandBox.Init(model, new Predicate <List <BattleCommand> >(this.OnStartBattle));
     this._uiCommandBox.isColliderEnabled = false;
     this._uiCommandUnitList.Init(model, new Action(this.OnUnitListDnDRelease));
     this._uiCommandUnitList.isColliderEnabled = false;
     this._uiOverlay.alpha = 0f;
     this._uiBlur.set_enabled(false);
     this.commandMode = BattleCommandMode.SurfaceBox;
     this._clsState   = new StatementMachine();
     return(true);
 }
示例#2
0
 private bool Init(CommandPhaseModel model)
 {
     _listInvalidCommands = GetInvalidCommands(model.GetSelectableCommands());
     _clsCommandModel     = model;
     _iInputMode          = InputMode.Key;
     _uiCommandBox.Init(model, OnStartBattle);
     _uiCommandBox.isColliderEnabled = false;
     _uiCommandUnitList.Init(model, OnUnitListDnDRelease);
     _uiCommandUnitList.isColliderEnabled = false;
     _uiOverlay.alpha = 0f;
     _uiBlur.enabled  = false;
     commandMode      = BattleCommandMode.SurfaceBox;
     _clsState        = new StatementMachine();
     return(true);
 }
示例#3
0
 private bool Init(CommandPhaseModel model)
 {
     this._clsState            = new StatementMachine();
     this._listInvalidCommands = this.GetInvalidCommands(model.GetSelectableCommands());
     this._clsCommandModel     = model;
     this._iCtrlModel          = CtrlBCCommandSelect.CtrlMode.Surface;
     this._isInputPossible     = false;
     this._uiCommandSurfaceList.Init(model.GetPresetCommand(), new Action <UICommandLabelButton>(this.OnSelectedSurface), new Predicate <List <BattleCommand> >(this.OnStartBattle));
     this._uiCommandSurfaceList.isColliderEnabled = false;
     this._uiCommandUnitSelect = UICommandUnitSelect.Instantiate(this._prefabUICommandUnitSelect.GetComponent <UICommandUnitSelect>(), base.get_transform(), model.GetSelectableCommands(), new Action <BattleCommand>(this.OnDecideUnitSelect), new Action(this.OnCancelUnitSelect));
     this.InitEnemyFleetInfos();
     this.panel.alpha            = 0f;
     this.panel.widgetsAreStatic = true;
     return(true);
 }
 public bool Init(CommandPhaseModel model, Predicate <List <BattleCommand> > onDeideBattleStart)
 {
     this._nSelectIndex = 0;
     base.get_transform().set_localPosition(this._vCommandBoxPos);
     this._actDecideBattleStart = onDeideBattleStart;
     this.CreateSurface(model.GetPresetCommand());
     this._uiBattleStartBtn.Init(this._listCommandSurface.get_Count(), new Func <bool>(this.DecideStartBattle));
     this._uiBattleStartBtn.transform.set_localPosition(this._vBattleStartBtnPos);
     this._uiBattleStartBtn.transform.localScaleZero();
     this._listICommandSurface.Add(this._uiBattleStartBtn);
     this.panel.alpha = 1f;
     this.ChkAllSurfaceSet();
     this._clsBackgrounds.Init();
     return(true);
 }
示例#5
0
 public bool Init(CommandPhaseModel model, Predicate <List <BattleCommand> > onDeideBattleStart)
 {
     _nSelectIndex = 0;
     base.transform.localPosition = _vCommandBoxPos;
     _actDecideBattleStart        = onDeideBattleStart;
     CreateSurface(model.GetPresetCommand());
     _uiBattleStartBtn.Init(_listCommandSurface.Count, DecideStartBattle);
     _uiBattleStartBtn.transform.localPosition = _vBattleStartBtnPos;
     _uiBattleStartBtn.transform.localScaleZero();
     _listICommandSurface.Add(_uiBattleStartBtn);
     panel.alpha = 1f;
     ChkAllSurfaceSet();
     _clsBackgrounds.Init();
     return(true);
 }
 private bool Init(CommandPhaseModel model)
 {
     _clsState            = new StatementMachine();
     _listInvalidCommands = GetInvalidCommands(model.GetSelectableCommands());
     _clsCommandModel     = model;
     _iCtrlModel          = CtrlMode.Surface;
     _isInputPossible     = false;
     _uiCommandSurfaceList.Init(model.GetPresetCommand(), OnSelectedSurface, OnStartBattle);
     _uiCommandSurfaceList.isColliderEnabled = false;
     _uiCommandUnitSelect = UICommandUnitSelect.Instantiate(((Component)_prefabUICommandUnitSelect).GetComponent <UICommandUnitSelect>(), base.transform, model.GetSelectableCommands(), OnDecideUnitSelect, OnCancelUnitSelect);
     InitEnemyFleetInfos();
     panel.alpha            = 0f;
     panel.widgetsAreStatic = true;
     return(true);
 }
        public bool Init(CommandPhaseModel model, Action onDragAndDropRelease)
        {
            _actOnDragAndDropRelease = onDragAndDropRelease;
            bool      flag      = !model.GetSelectableCommands().Contains(BattleCommand.Kouku) && !model.GetSelectableCommands().Contains(BattleCommand.Totugeki) && !model.GetSelectableCommands().Contains(BattleCommand.Tousha);
            Transform transform = base.transform.Find("CommandOrig");

            transform.localPosition = ((!flag) ? Vector3.zero : (Vector3.right * 100f));
            _listCommandUnits       = new List <UICommandUnitIcon>();
            _listCommandUnitOrigs   = new List <UISprite>();
            foreach (int value in Enum.GetValues(typeof(BattleCommand)))
            {
                if (value != -1)
                {
                    _listCommandUnits.Add(((Component)base.transform.FindChild($"CommandUnit{value}")).GetComponent <UICommandUnitIcon>());
                    _listCommandUnitOrigs.Add(((Component)base.transform.FindChild($"CommandOrig/Icon{value}")).GetComponent <UISprite>());
                    Vector3 localPosition = _listCommandUnits[value].transform.localPosition;
                    localPosition.x = ((!flag) ? localPosition.x : (localPosition.x + 100f));
                    _listCommandUnits[value].transform.localPosition = localPosition;
                    _listCommandUnits[value].Init((BattleCommand)value, model.GetSelectableCommands().Contains((BattleCommand)value) ? true : false, OnDragStart, OnDragAndDropRelease);
                    _listCommandUnits[value].SetActive(_listCommandUnits[value].isValid);
                    _listCommandUnitOrigs[value].SetActive(_listCommandUnits[value].isValid);
                }
            }
            _vSelectCommandPos = new Vector2(0f, 0f);
            _aryCommandsPos    = new BattleCommand[3, 3]
            {
                {
                    BattleCommand.Sekkin,
                    BattleCommand.Ridatu,
                    BattleCommand.Kouku
                },
                {
                    BattleCommand.Hougeki,
                    BattleCommand.Taisen,
                    BattleCommand.Totugeki
                },
                {
                    BattleCommand.Raigeki,
                    BattleCommand.Kaihi,
                    BattleCommand.Tousha
                }
            };
            return(true);
        }
        public bool Init(CommandPhaseModel model, Action onDragAndDropRelease)
        {
            this._actOnDragAndDropRelease = onDragAndDropRelease;
            bool      flag      = !model.GetSelectableCommands().Contains(BattleCommand.Kouku) && !model.GetSelectableCommands().Contains(BattleCommand.Totugeki) && !model.GetSelectableCommands().Contains(BattleCommand.Tousha);
            Transform transform = base.get_transform().Find("CommandOrig");

            transform.set_localPosition((!flag) ? Vector3.get_zero() : (Vector3.get_right() * 100f));
            this._listCommandUnits     = new List <UICommandUnitIcon>();
            this._listCommandUnitOrigs = new List <UISprite>();
            using (IEnumerator enumerator = Enum.GetValues(typeof(BattleCommand)).GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    BattleCommand battleCommand = (BattleCommand)((int)enumerator.get_Current());
                    if (battleCommand != BattleCommand.None)
                    {
                        this._listCommandUnits.Add(base.get_transform().FindChild(string.Format("CommandUnit{0}", (int)battleCommand)).GetComponent <UICommandUnitIcon>());
                        this._listCommandUnitOrigs.Add(base.get_transform().FindChild(string.Format("CommandOrig/Icon{0}", (int)battleCommand)).GetComponent <UISprite>());
                        Vector3 localPosition = this._listCommandUnits.get_Item((int)battleCommand).get_transform().get_localPosition();
                        localPosition.x = ((!flag) ? localPosition.x : (localPosition.x + 100f));
                        this._listCommandUnits.get_Item((int)battleCommand).get_transform().set_localPosition(localPosition);
                        this._listCommandUnits.get_Item((int)battleCommand).Init(battleCommand, model.GetSelectableCommands().Contains(battleCommand), new Action <BattleCommand>(this.OnDragStart), new Action(this.OnDragAndDropRelease));
                        this._listCommandUnits.get_Item((int)battleCommand).SetActive(this._listCommandUnits.get_Item((int)battleCommand).isValid);
                        this._listCommandUnitOrigs.get_Item((int)battleCommand).SetActive(this._listCommandUnits.get_Item((int)battleCommand).isValid);
                    }
                }
            }
            this._vSelectCommandPos   = new Vector2(0f, 0f);
            BattleCommand[,] expr_231 = new BattleCommand[3, 3];
            expr_231[0, 1]            = BattleCommand.Ridatu;
            expr_231[0, 2]            = BattleCommand.Kouku;
            expr_231[1, 0]            = BattleCommand.Hougeki;
            expr_231[1, 1]            = BattleCommand.Taisen;
            expr_231[1, 2]            = BattleCommand.Totugeki;
            expr_231[2, 0]            = BattleCommand.Raigeki;
            expr_231[2, 1]            = BattleCommand.Kaihi;
            expr_231[2, 2]            = BattleCommand.Tousha;
            this._aryCommandsPos      = expr_231;
            return(true);
        }
        public bool IsValidPresetCommand()
        {
            CommandPhaseModel commandPhaseModel = this.GetCommandPhaseModel();

            return(commandPhaseModel != null && commandPhaseModel.IsValidCommand(commandPhaseModel.GetPresetCommand()));
        }
示例#10
0
        public static ProdBattleCommandSelect Instantiate(ProdBattleCommandSelect prefab, Transform parent, CommandPhaseModel model)
        {
            ProdBattleCommandSelect prodBattleCommandSelect = Object.Instantiate <ProdBattleCommandSelect>(prefab);

            prodBattleCommandSelect.get_transform().set_parent(parent);
            prodBattleCommandSelect.get_transform().localScaleOne();
            prodBattleCommandSelect.get_transform().localPositionZero();
            prodBattleCommandSelect.Init(model);
            return(prodBattleCommandSelect);
        }
示例#11
0
        public static ProdBattleCommandSelect Instantiate(ProdBattleCommandSelect prefab, Transform parent, CommandPhaseModel model)
        {
            ProdBattleCommandSelect prodBattleCommandSelect = UnityEngine.Object.Instantiate(prefab);

            prodBattleCommandSelect.transform.parent = parent;
            prodBattleCommandSelect.transform.localScaleOne();
            prodBattleCommandSelect.transform.localPositionZero();
            prodBattleCommandSelect.Init(model);
            return(prodBattleCommandSelect);
        }
示例#12
0
        public bool IsValidPresetCommand()
        {
            CommandPhaseModel commandPhaseModel = GetCommandPhaseModel();

            return(commandPhaseModel?.IsValidCommand(commandPhaseModel.GetPresetCommand()) ?? false);
        }
示例#13
0
        public static CtrlBCCommandSelect Instantiate(CtrlBCCommandSelect prefab, Transform parent, CommandPhaseModel model)
        {
            CtrlBCCommandSelect ctrlBCCommandSelect = Object.Instantiate <CtrlBCCommandSelect>(prefab);

            ctrlBCCommandSelect.get_transform().set_parent(parent);
            ctrlBCCommandSelect.get_transform().localPositionZero();
            ctrlBCCommandSelect.get_transform().localScaleOne();
            ctrlBCCommandSelect.Init(model);
            return(ctrlBCCommandSelect);
        }
        public static CtrlBCCommandSelect Instantiate(CtrlBCCommandSelect prefab, Transform parent, CommandPhaseModel model)
        {
            CtrlBCCommandSelect ctrlBCCommandSelect = UnityEngine.Object.Instantiate(prefab);

            ctrlBCCommandSelect.transform.parent = parent;
            ctrlBCCommandSelect.transform.localPositionZero();
            ctrlBCCommandSelect.transform.localScaleOne();
            ctrlBCCommandSelect.Init(model);
            return(ctrlBCCommandSelect);
        }