public void Die() { isDead = true; renderer.material = deathMaterial; AudioSource.PlayClipAtPoint(deathSound, transform.position); GreedManager.PersonKilled(); }
void OnTriggerEnter(Collider other) { if (other.tag == "food") { GreedManager.TakeFood(); if (other.hingeJoint != null) { var needyPerson = other.hingeJoint.connectedBody.gameObject; Debug.Log(needyPerson.tag); if (needyPerson.tag != "crane") { GameObject.Destroy(needyPerson); } } GameObject.Destroy(other.gameObject); } }
void OnGUI() { GUILayout.Label(string.Format("Greed: {0}", GreedManager.TallyGreed())); GUILayout.Label(string.Format("Time Left: {0}", timer.TimeLeft.ToString("N1"))); }