本文整理汇总了C#中Actor.NotifyBlocker方法的典型用法代码示例。如果您正苦于以下问题:C# Actor.NotifyBlocker方法的具体用法?C# Actor.NotifyBlocker怎么用?C# Actor.NotifyBlocker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actor
的用法示例。
在下文中一共展示了Actor.NotifyBlocker方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Tick
public override Activity Tick(Actor self)
{
cargo.Unloading = false;
if (IsCanceled || cargo.IsEmpty(self))
return NextActivity;
if (cloak != null && cloak.Info.UncloakOn.HasFlag(UncloakType.Unload))
cloak.Uncloak();
var actor = cargo.Peek(self);
var spawn = self.CenterPosition;
var exitSubCell = ChooseExitSubCell(actor);
if (exitSubCell == null)
{
self.NotifyBlocker(BlockedExitCells(actor));
return ActivityUtils.SequenceActivities(new Wait(10), this);
}
cargo.Unload(self);
self.World.AddFrameEndTask(w =>
{
if (actor.Disposed)
return;
var move = actor.Trait<IMove>();
var pos = actor.Trait<IPositionable>();
actor.CancelActivity();
pos.SetVisualPosition(actor, spawn);
actor.QueueActivity(move.MoveIntoWorld(actor, exitSubCell.Value.First, exitSubCell.Value.Second));
actor.SetTargetLine(Target.FromCell(w, exitSubCell.Value.First, exitSubCell.Value.Second), Color.Green, false);
w.Add(actor);
});
if (!unloadAll || cargo.IsEmpty(self))
return NextActivity;
cargo.Unloading = true;
return this;
}
示例2: CanUseExit
static bool CanUseExit(Actor self, ActorInfo producee, ExitInfo s)
{
var mobileInfo = producee.TraitInfoOrDefault<MobileInfo>();
self.NotifyBlocker(self.Location + s.ExitCell);
return mobileInfo == null ||
mobileInfo.CanEnterCell(self.World, self, self.Location + s.ExitCell, self);
}