예제 #1
0
    public void Hurt()
    {
        currentLife--;
        if (currentLife <= 0)
        {
            deathAudioSource.Play();
            deathAudioPlayer.transform.parent = null;

            if (boss)
            {
                musicPlayer.Stop();
                BossFightEnder.GetInstance().WaitForSecondsAndLoadNextScene(deathAudioSource.clip.length);
            }

            Destroy(gameObject);
        }

        healthBar.localScale = new Vector3((float)currentLife / startLife, healthBar.localScale.y, healthBar.localScale.z);
    }
예제 #2
0
 void Start()
 {
     instance = this;
 }
예제 #3
0
 void Start()
 {
     instance = this;
 }