void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Vegetation")) { m_Agent.IncrementEnergy(energyIncrementOnVegContact); other.GetComponent <GAVegetation>().Remove(); } else if (other.CompareTag("Prey")) { m_Agent.IncrementEnergy(-energyDecrementOnPreyContact); } }
void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Prey")) { m_Agent.IncrementEnergy(energyIncrementOnPreyContact); other.GetComponent <GAAgent> ().Kill(); } else if (other.CompareTag("Predator")) { m_Agent.IncrementEnergy(-energyDecrementOnPredContact); } }