本文整理汇总了C#中CommandManager.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# CommandManager.GetComponent方法的具体用法?C# CommandManager.GetComponent怎么用?C# CommandManager.GetComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandManager
的用法示例。
在下文中一共展示了CommandManager.GetComponent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveTo
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;
}
示例2: checkResources
/// <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);
}