private void OnTriggerStay(Collider other) { if (other.gameObject.tag == "buggle") { Buggle theBuggle = other.GetComponent <Buggle>(); if (!theBuggle.enemy) { if (selector == null) { selector = GameObject.Find("selector"); } selector.GetComponent <Image>().enabled = true; if (thingToGrab == null) { thingToGrab = other.gameObject; } } else { playerHealthControler.takeDmg(theBuggle.touchDmg); } } if (other.gameObject.tag == "ground") { isGrounded = true; } }
private void OnTriggerEnter(Collider other) { healthControler livingObject = other.GetComponent <healthControler>(); if (livingObject != null) { livingObject.takeDmg(bulletDmg); } if (hitSplash != null) { var newHitSplash = Instantiate(hitSplash, transform.position, Quaternion.identity); } if (other.transform.parent != null) { drop_consumable drop = other.transform.parent.GetComponent <drop_consumable>(); if (drop == null) { Destroy(gameObject); } } else { Destroy(gameObject); } }