Пример #1
0
    private void Update()
    {
        if (lives <= 0)
        {
            GetComponent <PlayerController>().enabled = false;
            gameObject.transform.GetChild(0).GetComponent <FirePoint>().enabled = false;
            go.Defeat();
            //gameObject.SetActive(false);
        }

        if (isDead && lives >= 1)
        {
            lives--;
            sm.PlaySFX(1);
            lifeImages[lives].gameObject.SetActive(false);
            anim.SetBool("IsDead", isDead);
            Debug.Log(lives);
            isDead = false;
            if (Loader.level1 && lives > 0)
            {
                go.ResetLevel1();
            }
        }
        else if (isDead == false)
        {
            anim.SetBool("IsDead", isDead);
        }
    }
Пример #2
0
 void Fire()
 {
     //ObjectPool.Instance.SpawnBullet(transform);
     Instantiate(bullet, transform.position, Quaternion.identity);
     sm.PlaySFX(0);
 }