Example #1
0
        public static UICommandUnitSelect Instantiate(UICommandUnitSelect prefab, Transform parent, HashSet <BattleCommand> validCommands, Action <BattleCommand> onDecide, Action onCancel)
        {
            UICommandUnitSelect uICommandUnitSelect = Object.Instantiate <UICommandUnitSelect>(prefab);

            uICommandUnitSelect.get_transform().set_parent(parent);
            uICommandUnitSelect.get_transform().set_localPosition(Vector2.get_down() * 12f);
            uICommandUnitSelect.get_transform().set_localScale(Vector3.get_one() * 0.8f);
            uICommandUnitSelect.Init(validCommands, onDecide, onCancel);
            return(uICommandUnitSelect);
        }
        public static UICommandUnitSelect Instantiate(UICommandUnitSelect prefab, Transform parent, HashSet <BattleCommand> validCommands, Action <BattleCommand> onDecide, Action onCancel)
        {
            UICommandUnitSelect uICommandUnitSelect = UnityEngine.Object.Instantiate(prefab);

            uICommandUnitSelect.transform.parent        = parent;
            uICommandUnitSelect.transform.localPosition = Vector2.down * 12f;
            uICommandUnitSelect.transform.localScale    = Vector3.one * 0.8f;
            uICommandUnitSelect.Init(validCommands, onDecide, onCancel);
            return(uICommandUnitSelect);
        }
Example #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);
 }
 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);
 }