Beispiel #1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
         return;
     }
 }
Beispiel #2
0
 private bool CaptureWM(float minThreshold)
 {
     foreach (Transform wm in wonderMoments)
     {
         if (InRange(wm, minThreshold))
         {
             WonderMoment wmScript = wm.gameObject.GetComponent <WonderMoment> ();
             if (!wmScript.isCaptured())
             {
                 // Set capture flag on WM
                 wmScript.Capture();
                 animator.SetTrigger("Captured");
                 // Increase Life Force
                 LifeForce.UpdateMeter(0.1f);
                 return(true);
             }
         }
     }
     return(false);
 }