本文整理匯總了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);
}