Пример #1
0
    public void killPlayer()
    {
        sound.stopRainSound();
        move.toggleMovement();
        if (playDeath)
        {
            sound.playDeat();
            playDeath = false;
        }

        sound.setMusicInstruments(-1f);
        // GameObject deathBrick = Instantiate(death); // Here is bug

        GameObject instance = Instantiate(Resources.Load("PlayerDeath", typeof(GameObject))) as GameObject;

        //deathBrick.transform.position = gameObject.transform.position;
        instance.transform.position = gameObject.transform.position;

        StartCoroutine(waitToKill(death));
        StartCoroutine(waitGameOver());
    }