Exemple #1
0
    public void ChangeTurn()
    {
        TeamScript tS1 = transform.GetChild(0).GetComponent <TeamScript>();
        TeamScript tS2 = transform.GetChild(1).GetComponent <TeamScript>();

        GameTeamScript.GetInstance().StartCoroutine(checkGameOver(tS1, tS2.name));
        GameTeamScript.GetInstance().StartCoroutine(checkGameOver(tS2, tS1.name));
        if (currentTeamNumber == 1)
        {
            currentTeamNumber = 2;
            cameraScript.saveOld(calculateBestPosition(tS2), currentTeamNumber);
            cameraScript.setCameraTargetToCompleteView(currentTeamNumber);
        }
        else
        {
            currentTeamNumber = 1;
            cameraScript.saveOld(calculateBestPosition(tS1), currentTeamNumber);
            cameraScript.setCameraTargetToCompleteView(currentTeamNumber);
        }
        textUpdater.UpdateTeamValue(GameTeamScript.GetInstance().currentTeamNumber);
        textUpdater.UpdateUnitValue(null);
    }