private void OnTriggerEnter(Collider other) { if (TagList.ContainsTag(other.gameObject, Constants.TAG_PLAYER)) { _gameState.CompleteLevel(); } }
/** * * COLLISIONS * */ void OnCollisionExit(Collision collision) { if (TagList.ContainsTag(collision.gameObject, Constants.TAG_BOX)) { IsPushingBoxInX = false; IsPushingBoxInZ = false; } }
private void OnTriggerExit(Collider other) { if (TagList.ContainsTag(other.gameObject, Constants.TAG_BUTTON_PUSHER)) { _numberofPressingObjects--; UnpushButton(); } }
private void OnTriggerEnter(Collider other) { // Targets with the "Burnable" tag must implement Burn. // Currently only works with the Player if (TagList.ContainsTag(other.gameObject, Constants.TAG_BURNABLE)) { other.GetComponent <PlayerController>().Burn(); } }
private void OnTriggerEnter(Collider other) { if (TagList.ContainsTag(other.gameObject, Constants.TAG_PLAYER)) { // Addition - Add the value to the player's current energy if (PickupEffect.Equals(Constants.PICKUP_ADDITION)) { PlayerController playerController = other.gameObject.GetComponent <PlayerController>(); playerController.Energy += Value; Destroy(this.gameObject); } // Insert additional effects here } }
private bool IsCollidingWithPlayer(Collision collision) { return(TagList.ContainsTag(collision.gameObject, Constants.TAG_ENEMY)); }
public static bool ContainsTag(GameObject gameObject, string tag) { TagList tags = gameObject.GetComponent <TagList>(); return(tags != null && tags.ContainsTag(tag)); }