コード例 #1
0
ファイル: RatPlayer.cs プロジェクト: sjb160130/Astro-Rat
    public void Kill()
    {
        if (Dead)
        {
            return;
        }
        Dead = true;

        Debug.Log("Player " + this.PlayerID + " killed");

        if (GameState.Instance.IsPlaying)
        {
            StartCoroutine(HandleDeathAndRespawn());
        }
        this.gameObject.layer = LayerMask.NameToLayer("Player Dead");

        AudioManager.Instance.PlaySound(this.Sounds.Die, this.transform.position, volume: 1f);

        Helmet.Spawn(this.transform.position);
    }