Example #1
0
 /// <summary>
 /// If this object intersects its target zone, the transition to the next state is triggered.
 /// </summary>
 /// <param name="other">The collider of the intersected object</param>
 private void OnTriggerEnter(Collider other)
 {
     if (other.name == "TargetZoneStartTransition")
     {
         if (grab.EndInteractAllowed())
         {
             grab.EndInteraction(grab.GrabScript, true);
         }
         StateManager.Instance.GoToNextState();
     }
 }
Example #2
0
 /// <summary>
 /// If this object (aka Roboy's head) is pulled close enough,
 /// the transition to the HUD gets initiated and this object's position and orientation are resetted
 /// </summary>
 /// <param name="other">The other collider this object starts intersecting with</param>
 private void OnTriggerEnter(Collider other)
 {
     if (other.name == "TargetZoneStartTransition")
     {
         StateManager.Instance.GoToNextState();
         if (grab.EndInteractAllowed())
         {
             grab.EndInteraction(grab.GrabScript, true);
             this.transform.localPosition = defaultPos;
             this.transform.localRotation = defaultRot;
         }
     }
 }