コード例 #1
0
    IEnumerator HaterDeath()
    {
        ++GameSceneController.kills;

        if (haterCurrentExp > 0)
        {
            GameSceneController.playerScore = GameSceneController.playerScore + haterCurrentExp;
        }
        if (GameSceneController.playerScore > GameSceneController.levelsMaxScores [GameSceneController.playerLevelNumber])
        {
            GameSceneController.playerScore = GameSceneController.levelsMaxScores [GameSceneController.playerLevelNumber];
        }
        this.gameObject.GetComponent <CanvasGroup> ().interactable = false;
        this.gameObject.GetComponent <CanvasGroup> ().alpha        = 0f;
        if (GameSceneController.playerSoundSetting == 1)
        {
            if (haterType == 0)
            {
                HaterAudio.PlayOneShot(sream1, 1f);
            }
            if (haterType == 1)
            {
                HaterAudio.PlayOneShot(sream2, 0.5f);
            }
            if (haterType == 2)
            {
                HaterAudio.PlayOneShot(sream3, 0.5f);
            }
        }
        --HaterPlateManager.currentPlatesInScreen;
        string haterPlateName = gameObject.name;

        if (haterPlateName == "plate0")
        {
            HaterPlateManager.socket0Full = false;
        }
        if (haterPlateName == "plate1")
        {
            HaterPlateManager.socket1Full = false;
        }
        if (haterPlateName == "plate2")
        {
            HaterPlateManager.socket2Full = false;
        }
        if (haterPlateName == "plate3")
        {
            HaterPlateManager.socket3Full = false;
        }
        if (haterPlateName == "plate4")
        {
            HaterPlateManager.socket4Full = false;
        }
        if (haterPlateName == "plate5")
        {
            HaterPlateManager.socket5Full = false;
        }
        if (haterPlateName == "plate6")
        {
            HaterPlateManager.socket6Full = false;
        }
        if (haterPlateName == "plate7")
        {
            HaterPlateManager.socket7Full = false;
        }
        if (haterPlateName == "plate8")
        {
            HaterPlateManager.socket8Full = false;
        }
        if (haterPlateName == "plate9")
        {
            HaterPlateManager.socket9Full = false;
        }
        if (haterPlateName == "plate10")
        {
            HaterPlateManager.socket10Full = false;
        }
        if (haterPlateName == "plate11")
        {
            HaterPlateManager.socket11Full = false;
        }

        if (IsBoss)
        {
            GameSceneController.roundWin = true;             // Завершение игры победой
            GameSceneController.WinLevelFinish();
        }

        yield return(new WaitForSeconds(2f));

        gameObject.SetActive(false);
    }