예제 #1
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (!capSite)
     {
         return;
     }
     capSite.ResetCaptureStatus();
     capSite.SetCapturer(null);
     UpdateUI();
 }
예제 #2
0
    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);
    }