public MoveTo(CommandManager parent,Vector3 target) { m_target = target; m_parent = parent; //find the navagation agent and set the destination m_parent.GetComponent<NavMeshAgent>().destination = m_target; }
/// <summary> /// check if the unit that owns <paramref name="manager"/> has enough resources /// to build the unit detailed in info /// </summary> /// <param name="manager">the manager to check aganst</param> /// <param name="info">the unit to check</param> /// <returns>true if the player can build info, false otherwise</returns> public static bool checkResources(CommandManager manager, IUnitInfo info) { Units.Resources cost = info.Cost; Units.Resources harvested = manager.GetComponent<BasicController>().Owner.HarvestedResources; return harvested.HasEnoughResources(cost); }