private void OnTriggerExit2D(Collider2D collision) { if (!capSite) { return; } capSite.ResetCaptureStatus(); capSite.SetCapturer(null); UpdateUI(); }
private void OnTriggerEnter2D(Collider2D collision) { int collisionIFF = collision.transform.root.GetComponentInChildren <IFF>().GetIFFAllegiance(); int ownIFF = transform.root.GetComponentInChildren <IFF>().GetIFFAllegiance(); if (collisionIFF == ownIFF) { return; } capSite = collision.GetComponent <CaptureSite>(); capSite.SetCapturer(this); }