예제 #1
0
파일: PointSampler.cs 프로젝트: R-N/Skid
    public void OnPointerUp(PointerEventData data)
    {
        RaycastHit hit;

        if (cancelArea != null && cancelArea.CheckScreenPoint(data))
        {
            cancelHandler();
        }
        else
        {
            if (CameraView.RaycastScreen(data.position, out hit, mask))
            {
                //NavMeshHit nmHit;
                //if (NavMesh.SamplePosition (hit.point, out nmHit, 0.1f, NavMesh.AllAreas))
                v3upHandler(hit.point);
                //else
                //	v3upHandler (MyExtensions.v3Inf);
            }
        }
        if (cancelArea != null)
        {
            cancelArea.gameObject.SetActive(false);
        }
        Done();
    }
예제 #2
0
 public void OnPointerUp(PointerEventData data)
 {
     if (cancelArea != null && cancelArea.CheckScreenPoint(data))
     {
         cancelHandler();
     }
     else
     {
         Vector2 delta = data.position - startPoint;
         float   mag   = delta.magnitude;
         if (mag <= cancelRadius)
         {
             dir = Vector2.zero;
         }
         else
         {
             dir = delta / mag;
         }
         v2upHandler(dir);
     }
     if (cancelArea != null)
     {
         cancelArea.gameObject.SetActive(false);
     }
     Stop();
 }