Пример #1
0
        public static bool ActionNav(XEntity entity, Vector3 dest)
        {
            XNavComponent nav = entity.GetComponent <XNavComponent>();

            if (nav != null)
            {
                nav.Navigate(dest);
                entity.MoveForward(dest - entity.Position);
                return(true);
            }
            return(false);
        }
Пример #2
0
 public static bool NavToTarget(XEntity entity, GameObject target)
 {
     if (entity == null)
     {
         return(false);
     }
     if (target != null)
     {
         XNavComponent nav = entity.GetComponent <XNavComponent>();
         if (nav != null)
         {
             nav.Navigate(target.transform.position);
             entity.MoveForward(target.transform.position - entity.Position);
             return(true);
         }
     }
     return(false);
 }
Пример #3
0
 public void Navigate(Vector3 pos)
 {
     nav.Navigate(pos);
 }