/* * Destroys the agent, and rewards the player with points! Also adds a referece of the kill to the directors 'kills' list * and totalKills variables. Additionaly, instantiates GameObjects to play a death sound, and particle affect */ void Die() { dead = true; Instantiate(onDeathSound); Instantiate(deathSplatter, transform.position, transform.rotation); Destroy(gameObject); director.AddScore(scoreReward); director.AddKill(); }