コード例 #1
0
ファイル: GrabRoboy.cs プロジェクト: soapinduty/OUI2
 /// <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();
     }
 }
コード例 #2
0
ファイル: GrabRoboy.cs プロジェクト: Roboy/Roboy-UI-Prototype
 /// <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;
         }
     }
 }