// Use this for initialization void Start () { theSpawnDoor = GameObject.Find ("winningConditions").GetComponent <spawnDoor> (); Time.timeScale = 1; thePlayerScore = GameObject.Find("_GM").GetComponent<scoreController> (); thePlayerHealth = GameObject.Find("Player").GetComponent <playerHealth> (); }
public void makeDead() { Destroy(gameObject); Instantiate(deathFX, transform.position, transform.rotation); if (drops) { Instantiate(theDrop, transform.position, transform.rotation); } Destroy(transform.parent.gameObject); if (finalBoss) { spawnDoor doorSpawner = winConditions.GetComponent <spawnDoor>(); doorSpawner.winChecker = true; AudioSource.PlayClipAtPoint(bossDeathSound, transform.position, 1f + (PlayerPrefs.GetFloat("mySFXVolume") / 40)); } else { int index = Random.Range(0, deathSound.Length); AudioSource.PlayClipAtPoint(deathSound[index], transform.position, 1f + (PlayerPrefs.GetFloat("mySFXVolume") / 40)); } }
// Use this for initialization void Start() { GameObject door = GameObject.FindGameObjectWithTag("Door"); winDoor = door.GetComponent <spawnDoor>(); }