private void OnTriggerEnter(Collider other) { if (other.gameObject == GameObject.Find("CustomFPC")) { Destroy(gameObject); ninjaManager.addHealth(healthPoints); // health + 10; ninjaManager.keepScore(10.0f); //Debug.Log("EATING THE CAKE"); } }
private void OnTriggerEnter(Collider other) { if (other.gameObject == GameObject.Find("CustomFPC")) { parent = transform.parent.gameObject; Behaviour halo = (Behaviour)parent.GetComponent("Halo"); halo.enabled = false; // false Destroy(gameObject); ninjaManager.addHealth(healthPoints); //health + 5; ninjaManager.keepScore(5.0f); Debug.Log("EATING THe COOKIE"); } }