Beispiel #1
0
 protected virtual void DoDestinationMarkerSet(object sender, DestinationMarkerEventArgs e)
 {
     if (e.raycastHit.transform == transform)
     {
         currentDestinationPoint = this;
         if (snapToPoint)
         {
             e.raycastHit.point = destinationLocation.position;
             setDestination     = StartCoroutine(DoDestinationMarkerSetAtEndOfFrame(e));
         }
     }
     else if (currentDestinationPoint != this)
     {
         ResetPoint();
     }
 }
Beispiel #2
0
 protected virtual void ResetPoint()
 {
     currentDestinationPoint = null;
     ToggleObject(hoverCursorObject, false);
     if (enableTeleport)
     {
         pointCollider.enabled = true;
         ToggleObject(defaultCursorObject, true);
         ToggleObject(lockedCursorObject, false);
     }
     else
     {
         pointCollider.enabled = false;
         ToggleObject(lockedCursorObject, true);
         ToggleObject(defaultCursorObject, false);
     }
 }
 protected virtual void DoDestinationMarkerSet(object sender, DestinationMarkerEventArgs e)
 {
     if (e.raycastHit.transform == transform)
     {
         currentDestinationPoint = this;
         if (snapToPoint)
         {
             if (teleporter != null)
             {
                 teleporter.SetActualTeleportDestination(destinationLocation.position, GetRotation());
             }
             DisablePoint();
         }
     }
     else if (currentDestinationPoint != this)
     {
         ResetPoint();
     }
     else if (currentDestinationPoint != null && e.raycastHit.transform != currentDestinationPoint.transform)
     {
         currentDestinationPoint = null;
         ResetPoint();
     }
 }