void OnTriggerExit(Collider other) { if (other.tag == "TankTrigger") { TankRangeTrigger otherScript = other.GetComponent <TankRangeTrigger>(); tankScript.RemoveTarget(otherScript.tankScript.myTargetID); } }
void OnTriggerEnter(Collider other) { if (other.tag == "TankTrigger") { TankRangeTrigger otherScript = other.GetComponent <TankRangeTrigger>(); tankScript.AddNewTarget(otherScript.tankScript.myTargetID); } }