Exemplo n.º 1
0
		void OnTriggerEnter(Collider other) {
			if (other.tag == "Player") {
				gameObject.layer = 9;
				GameObject.Instantiate(Resources.Load("CogeDonuts"), transform.position, Quaternion.identity);
				if (transform.localScale.x < 1.5f) {
					other.SendMessage("AddDonut");
				} else {
					other.SendMessage("Victoria");
				}
				GetComponent<AudioSource>().Play();
			}
		}
        public override void OnTriggerEnter(Collider otherObject)
        {
            Debug.Log("MiningLaser hit " + otherObject.name);

            //mining laser only damages asteroids
            if (otherObject.CompareTag("Asteroid"))
                otherObject.SendMessage("TakeDamage", 1);
        }
Exemplo n.º 3
0
 public virtual void OnTriggerEnter(Collider otherObject)
 {
     Debug.Log("Weapon hit " + otherObject.name);
     otherObject.SendMessage("TakeDamage", 1);
 }
Exemplo n.º 4
0
		void OnTriggerEnter(Collider other){
			other.SendMessage ("Damage", GetAttackInfo());
			status.SetLastAttackTarget (other.transform.root.gameObject); 
			PlayAudio ();
		}
 public override void OnTriggerEnter(Collider otherObject)
 {
     Debug.Log("Projectile hit " + otherObject.name);
     otherObject.SendMessage("TakeDamage", 1);
     Destroy(gameObject);
 }