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); }
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); }
public void Navigate(Vector3 pos) { nav.Navigate(pos); }