当前位置: 首页>>代码示例>>C#>>正文


C# Unit.GetCommander方法代码示例

本文整理汇总了C#中Unit.GetCommander方法的典型用法代码示例。如果您正苦于以下问题:C# Unit.GetCommander方法的具体用法?C# Unit.GetCommander怎么用?C# Unit.GetCommander使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Unit的用法示例。


在下文中一共展示了Unit.GetCommander方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCaptured

 public virtual void OnCaptured(Unit capturer)
 {
     Debug.Log (capturer+" scored!");
     capturer.Score();
     capturer.currentObjective = null;
     capturer.attackObjective = null;
     capturer.GetCommander().attackObjective = null;
 }
开发者ID:Jay2645,项目名称:ludum-dare-7dRTS,代码行数:8,代码来源:Objective.cs

示例2: OnContestantEnter

 protected override void OnContestantEnter(Unit contestant)
 {
     if(carrying == null && !OwnsObjective(contestant))
     {
         CancelInvoke();
         transform.parent = contestant.transform;
         transform.localPosition = new Vector3(-0.4f, -0.05f, 0.5f);
         transform.localRotation = Quaternion.Euler(new Vector3(0, 180, 0));
         contestant.currentObjective = this;
         carrying = contestant;
         carrying.aBase.captureIndex = 0;
         captureIndex = 1;
         Commander carryCommander = carrying.GetCommander();
         if(carryCommander != null)
             carryCommander.attackObjective = carrying.aBase;
         carrying.attackObjective = carrying.aBase;
         carrying.currentObjective = carrying.aBase;
         carrying.OnPickupFlag();
         Invoke("Reset",Time.deltaTime * 2);
     }
 }
开发者ID:Jay2645,项目名称:ludum-dare-7dRTS,代码行数:21,代码来源:Flag.cs

示例3: IsFriendly

 public bool IsFriendly(Unit other)
 {
     return GetCommander() == other.GetCommander();
 }
开发者ID:Jay2645,项目名称:ludum-dare-7dRTS,代码行数:4,代码来源:Unit.cs

示例4: OwnsObjective

 /// <summary>
 /// Checks to see if a Unit's team owns this objective.
 /// </summary>
 /// <returns>
 /// TRUE if the Unit's team owns the objective, else FALSE.
 /// </returns>
 /// <param name='query'>
 /// The Unit in question.
 /// </param>
 protected bool OwnsObjective(Unit query)
 {
     return query != null && owner != null && query.GetCommander() == owner;
 }
开发者ID:Jay2645,项目名称:ludum-dare-7dRTS,代码行数:13,代码来源:Objective.cs


注:本文中的Unit.GetCommander方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。