本文整理汇总了C#中Actor.AppearsHostileTo方法的典型用法代码示例。如果您正苦于以下问题:C# Actor.AppearsHostileTo方法的具体用法?C# Actor.AppearsHostileTo怎么用?C# Actor.AppearsHostileTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actor
的用法示例。
在下文中一共展示了Actor.AppearsHostileTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDiscovered
public void OnDiscovered(Actor self, Player discoverer, bool playNotification)
{
if (!playNotification || discoverer != self.World.RenderPlayer)
return;
// Hack to disable notifications for neutral actors so some custom maps don't need fixing
// At this point it's either neutral or an enemy
if (!Info.AnnounceNeutrals && !self.AppearsHostileTo(discoverer.PlayerActor))
return;
// Audio notification
if (discoverer != null && !string.IsNullOrEmpty(Info.Notification))
Game.Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Faction.InternalName);
// Radar notificaion
if (Info.PingRadar && radarPings.Value != null)
radarPings.Value.Add(() => true, self.CenterPosition, Color.Red, 50);
}
示例2: CanTargetActor
public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor)
{
if (!base.CanTargetActor(self, target, forceAttack, forceQueued, ref cursor))
return false;
if (target.AppearsHostileTo(self))
return false;
if (!target.HasTrait<AcceptsSupplies>())
return false;
IsQueued = forceQueued;
return true;
}