Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (currentHealth <= 0)
        {
            currentLives -= 1;
            shipAnimator.SetTrigger("DeathAnimTrigger");

            fireEffect = FindObjectOfType <FireScript>();
            if (fireEffect != null)
            {
                fireEffect.DestroyFire();
            }
            playerShoot = FindObjectOfType <PlayerAttack>();
            if (playerShoot != null)
            {
                playerShoot.Destroy();
            }

            //GameEventScript.current.playerDeath();
            //Destroy(gameObject);
        }
    }