Esempio n. 1
0
    private void StartTurn()
    {
        List <TacticsUnit> list = teamDictionary[teamOrder[currentTeam]];

        //Se for Player, libera para que todos
        if (teamOrder[currentTeam] == Team.Player)
        {
            foreach (TacticsUnit unit in list)
            {
                unit.SetStamina(true);
                unit.BeginTurn();
            }
            SelectionController.disabled = false;
        }
        //Se for Enemy ou Other, libera o primeiro e o resto será liberado na chamada do EndTurn
        else
        {
            foreach (TacticsUnit unit in list)
            {
                unit.SetStamina(true);
            }
            list[0].BeginTurn();
        }

        TacticsCamera.FocusOn(list[0].gameObject);
    }
Esempio n. 2
0
    private void SetupBattle()
    {
        battleAnimator.SetupScene(actions[0].attacker.GetComponent <SpriteRenderer>().sprite, actions[0].defender.GetComponent <SpriteRenderer>().sprite);
        _attackerDealtDamage = false;
        _defenderDealtDamage = false;

        battleAnimationObject.transform.localPosition = new Vector3(
            cameraPosX.value,
            cameraPosY.value,
            battleAnimationObject.transform.localPosition.z
            );
        TacticsCamera tacticsCamera = GameObject.FindObjectOfType <TacticsCamera>();

        battleAnimationObject.transform.SetParent(tacticsCamera.transform);
        battleAnimationObject.transform.localPosition = new Vector3(0, 0, 5);
        battleAnimationObject.SetActive(showBattleAnim);
        uiCanvas.gameObject.SetActive(!showBattleAnim);
        uiCanvas.gameObject.SetActive(false);

        //Music
        MapEntry map = (MapEntry)currentMap.value;

        subMusic.value = (actions[0].type == BattleAction.Type.DAMAGE) ? map.mapMusic.battleTheme.clip : map.mapMusic.healTheme.clip;
        playTransitionMusicEvent.Invoke();
    }
Esempio n. 3
0
    private void SetSelection(GameObject selection)
    {
        currentSelection = selection;
        TacticsUnit tacticsUnit = selection.GetComponent <TacticsUnit>();

        switch (selection.tag)
        {
        case "Player":
            if (tacticsUnit)
            {
                if (tacticsUnit.CheckStamina())
                {
                    playerPanel.StartMainPanel(tacticsUnit);
                }
                else
                {
                    playerPanel.StartInfoPanel(tacticsUnit);
                }
            }
            break;

        case "Enemy":
        case "Other":
            if (tacticsUnit)
            {
                playerPanel.StartInfoPanel(tacticsUnit);
            }
            break;
        }

        TacticsCamera.FocusOn(selection);
    }
Esempio n. 4
0
    private void Awake()
    {
        cam = GameObject.Find("TacticsCamera").GetComponent <TacticsCamera>();
        currentSizeIndex = cam.currentZoomIndex;
        canvasSize       = canvasSizes[currentSizeIndex];
        var rect = gameObject.GetComponent <RectTransform>();

        rect.localScale = new Vector3(canvasSize, canvasSize, canvasSize);
        rect.transform.localPosition = new Vector3(rect.transform.localPosition.x, canvasHeights[currentSizeIndex], rect.transform.localPosition.z);
    }
Esempio n. 5
0
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
 }
Esempio n. 6
0
    public override void CallMovement()
    {
        if (unit && unit.MovementPoint)
        {
            FindNearestTarget();
            CalculatePath();
            FindSelectableTiles();
            actualTargetTile.Target = true;

            TacticsCamera.FocusOn(gameObject);
        }
    }
Esempio n. 7
0
 // Use this for initialization
 void Start()
 {
     tacticsCamera = GameObject.Find("TacticsCamera").GetComponent <TacticsCamera>();
 }