Ejemplo n.º 1
0
 private void OnMouseDown()
 {
     if (sendObject)
     {
         sendObject.SetDestination(targetPosition);
     }
 }
Ejemplo n.º 2
0
    private void Update()
    {
        Vector3    mpos = Input.mousePosition;
        Ray        ray  = Camera.main.ScreenPointToRay(mpos);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit))
        {
            if (!hit.collider.CompareTag("Player"))
            {
                Vector3 target = hit.point;
                if (Vector3.Distance(target, setDestination) > resetDestinationDistance)
                {
                    setDestination = target;
                    navCon.SetDestination(target);
                }
            }
        }
    }