本文整理汇总了C#中Actor.ChangeOwner方法的典型用法代码示例。如果您正苦于以下问题:C# Actor.ChangeOwner方法的具体用法?C# Actor.ChangeOwner怎么用?C# Actor.ChangeOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actor
的用法示例。
在下文中一共展示了Actor.ChangeOwner方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginCapture
public void BeginCapture(Actor self, Actor captor)
{
CaptureProgressTime = 0;
this.captor = captor;
if (self.Owner != self.World.WorldActor.Owner)
self.ChangeOwner(self.World.WorldActor.Owner);
}
示例2: Tick
public void Tick(Actor self)
{
if (!self.IsInWorld)
return;
if (--remaining == 0)
{
changingOwner = originalOwner;
self.ChangeOwner(originalOwner);
self.CancelActivity(); // Stop shooting, you have got new enemies
}
}
示例3: MaybeTransform
void MaybeTransform(Actor self, Actor passenger, string transformTo)
{
if (info.PassengerTypes.Contains(passenger.Info.Name) && transformTo != null)
{
self.World.AddFrameEndTask( w =>
{
var facing = self.TraitOrDefault<IFacing>();
var transform = new Transform(self, transformTo) { SkipMakeAnims = info.SkipMakeAnims };
if (facing != null) transform.Facing = facing.Facing;
self.CancelActivity();
self.QueueActivity(transform);
if (info.BecomeNeutral) self.ChangeOwner(self.World.WorldActor.Owner);
});
}
}
示例4: BeginCapture
public bool BeginCapture(Actor self, Actor captor)
{
if (!CaptureInProgress && !self.Trait<Building>().Lock())
return false;
if (CaptureInProgress && Captor.Owner.Stances[captor.Owner] == Stance.Ally)
return false;
CaptureProgressTime = 0;
this.Captor = captor;
if (self.Owner != self.World.WorldActor.Owner)
self.ChangeOwner(self.World.WorldActor.Owner);
return true;
}
示例5: Tick
public void Tick(Actor self)
{
if (!CaptureInProgress) return;
if (CaptureProgressTime < Info.CaptureCompleteTime * 25)
CaptureProgressTime++;
else
{
self.World.AddFrameEndTask(w =>
{
self.ChangeOwner(captor.Owner);
foreach (var t in self.TraitsImplementing<INotifyCapture>())
t.OnCapture(self, captor, self.Owner, captor.Owner);
foreach (var t in captor.World.ActorsWithTrait<INotifyOtherCaptured>())
t.Trait.OnActorCaptured(t.Actor, self, captor, self.Owner, captor.Owner);
captor = null;
});
}
}
示例6: ChangeOwner
public void ChangeOwner(Actor self, Player newOwner, int duration)
{
remaining = this.duration = duration;
changingOwner = newOwner;
self.ChangeOwner(newOwner);
}
示例7: ChangeOwnership
void ChangeOwnership(Actor self, Actor captor)
{
self.World.AddFrameEndTask(w =>
{
if (self.Disposed || captor.Disposed)
return;
// prevent (Added|Removed)FromWorld from firing during Actor.ChangeOwner
skipTriggerUpdate = true;
var previousOwner = self.Owner;
self.ChangeOwner(captor.Owner);
if (self.Owner == self.World.LocalPlayer)
w.Add(new FlashTarget(self));
foreach (var t in self.TraitsImplementing<INotifyCapture>())
t.OnCapture(self, captor, previousOwner, captor.Owner);
});
}