Пример #1
0
    void UpdateDurability(int damage)
    {
        durability -= damage;

        Debug.Log("エネミーからのダメージ :" + damage);

        durability = Mathf.Clamp(durability, 0, maxDurability);

        gameManager.uiManager.DisplayDurability(durability, maxDurability);



        // TODO 耐久力が0以下になってないか確認
        if (durability <= 0 && gameManager.isGameUp == false)
        {
            gameManager.SwitchGameUp(true);

            SoundManager.instance.PlaySE(SoundDataSO.SeType.GameOver);
            SoundManager.instance.PlayVoice(SoundDataSO.VoiceType.Lose);

            gameManager.PreparateGameOver();
        }
    }