示例#1
0
    public void GameEndTurn()
    {
        startTurn = false;
        characterUI.UIDisable();
        currentTurnCharacter.isPlaying = false;

        //If player is outside
        if (currentTurnCharacter.isPlayerOutside)
        {
            currentTurnCharacter.TakeDamage(ushort.MaxValue);
            if (CheckAllUnitDeath())
            {
                GM.PlayerSwitch();
                //If player kill self and other player already deadth
                if (CheckAllUnitDeath())
                {
                    //Then player that kill self, won
                    GM.PlayerSwitch();
                }
                camControl.cameraAfterControl   = false;
                camControl.CameraCurrentControl = GM.isPlayerBlue ? CameraController.CameraControlEnum.playerBlueView : CameraController.CameraControlEnum.playerRedView;
                Debug.Log("Player: " + (GM.isPlayerBlue ? "blue" : "red") + " won");
                gameEndObject.SetActive(true);
                victoryText.text = "Team " + (GM.isPlayerBlue ? "BLUE" : "RED");
                return;
            }
        }
        GameNextTurn();
    }