Esempio n. 1
0
    public void DamageByEnemy()
    {
        if (isDead) //죽으면
        {
            return; //끝
        }
        --hp;

        cameraShake.PlayCameraShake();

        if (hp == 3)
        {
            GetComponent <AudioSource>().PlayOneShot(playerStateVoiseSound[1]);
        }
        if (hp == 1)
        {
            GetComponent <AudioSource>().PlayOneShot(playerStateVoiseSound[1]);
        }

        if (hp <= 0)
        {
            isDead           = true;
            Cursor.lockState = CursorLockMode.None;
            Cursor.visible   = true;
            //결과 Scene으로 이동
            SceneMrg sceneManager = GameObject.Find("GameManager").GetComponent <SceneMrg>();
            sceneManager.GotoResultScene();
        }
    }
Esempio n. 2
0
    public void DamageByEnemy()
    {
        if (isDead) //죽으면
        {
            return; //끝
        }
        --hp;

        cameraShake.PlayCameraShake();


        if (hp <= 0)
        {
            isDead = true;

            //결과 Scene으로 이동
            SceneMrg sceneManager = GameObject.Find("GameManager").GetComponent <SceneMrg>();
            sceneManager.GotoResultScene();
        }
    }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     sceneManager = GetComponent <SceneMrg>();
 }