public override void Construct(BattleManager battleManager, Map map, BattleController currentBattleController)
        {
            this.battleManager           = battleManager;
            this.map                     = map;
            this.currentBattleController = currentBattleController;
            mainUI = battleManager.mainUI;

            currentCharControl             = (CharacterBattleController)currentBattleController;
            _currentCharacterDataComponent = currentCharControl.characterDataComponent;

            Tile curTile = _currentCharacterDataComponent.position;

            Vector3 curTilePoint =
                map.GetCoordByTileIndexes(curTile.x, curTile.z, curTile.y);
            Vector3 vect  = curTilePoint + new Vector3(0, 0.7f, 0);
            Vector2 vect2 = Camera.main.WorldToScreenPoint(vect);

            confirmButtonGameObject =
                Instantiate(Resources.Load("UIElements/ConfirmBtn")) as GameObject;
            confirmButtonGameObject.transform.SetParent(mainUI.transform, false);
            confirmButton = confirmButtonGameObject.GetComponent <Button>();
            confirmButton.onClick.AddListener(ConfirmTarget);
            confirmButtonGameObject.GetComponent <UIinSpace>()
            .Initiate(vect, new Vector2(20, 45));
        }
        public override void Construct(BattleManager battleManager, Map map, BattleController currentBattleController)
        {
            this.battleManager           = battleManager;
            this.map                     = map;
            this.currentBattleController = currentBattleController;
            mainUI = battleManager.mainUI;

            currentCharControl             = (CharacterBattleController)currentBattleController;
            _currentCharacterDataComponent = currentCharControl.characterDataComponent;

            currentCharControl.DeltaAPRed(2);

            initiated = true;
        }
示例#3
0
        public override void Construct(BattleManager battleManager, Map map, BattleController currentBattleController)
        {
            this.battleManager           = battleManager;
            this.map                     = map;
            this.currentBattleController = currentBattleController;
            mainUI = battleManager.mainUI;

            currentCharControl             = (CharacterBattleController)currentBattleController;
            _currentCharacterDataComponent = currentCharControl.characterDataComponent;

            maxPathLength = _currentCharacterDataComponent.ap *
                            (_currentCharacterDataComponent.speed + _currentCharacterDataComponent.speedModifier);

            initiated = true;
        }
示例#4
0
 private void Awake()
 {
     characterDataComponent = this.gameObject.GetComponent <CharacterDataComponent>();
     // Debug.Log(characterDataComponent.name);
 }