void OnTriggerStay(Collider other) { if (other.gameObject.tag == "Player") { other.GetComponentInChildren<PlayerShooting>().BounceTimer = 0; Destroy(gameObject, 1); } }
void OnTriggerEnter(Collider other) { // If the entering collider is the player... if (other.tag == "Player") { PlayerShooting playerShooting = other.GetComponentInChildren<PlayerShooting>(); if (playerShooting != null) { playerShooting.AddAmmo(ARTIFACT_AMOUNT); Destroy(gameObject); } } }
void OnTriggerEnter(Collider other) { if (other.CompareTag("Player1_") || other.CompareTag("Player2_") || other.CompareTag("Player3_") || other.CompareTag("Player4_")) { ShipPartDestroy partScript = other.GetComponentInParent<ShipPartDestroy>(); if (partScript != null) { // Found in parent, repair partScript.RepairAllParts(); } else { // Look to children for the part object partScript = other.GetComponentInChildren<ShipPartDestroy>(); if (partScript != null) { partScript.RepairAllParts(); } } } }
void OnTriggerExit(Collider other) { Text text = other.GetComponentInChildren<Text> (); if (text == null) { return; } text.color = textColor; }
void OnTriggerStay(Collider other){ Text text = other.GetComponentInChildren<Text>(); if (text == null) { return; } text.color = Color.white; CurrentHilightValue = text.text; }
void OnTriggerEnter(Collider other) { // TODO: There should be no need for a collider on labels to derive a highlight. Text text = other.GetComponentInChildren<Text>(); if (text == null) { return; } text.color = Color.white; }