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


C# Actor.ChangeOwner方法代码示例

本文整理汇总了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);
        }
开发者ID:sonygod,项目名称:OpenRA-Dedicated-20120504,代码行数:9,代码来源:Capturable.cs

示例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
			}
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:12,代码来源:TemporaryOwnerManager.cs

示例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);
                });
            }
        }
开发者ID:RobotCaleb,项目名称:OpenRA,代码行数:16,代码来源:TransformOnPassenger.cs

示例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;
        }
开发者ID:Iran,项目名称:ClassicRA,代码行数:17,代码来源:Capturable.cs

示例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;
                });
            }
        }
开发者ID:sonygod,项目名称:OpenRA-Dedicated-20120504,代码行数:22,代码来源:Capturable.cs

示例6: ChangeOwner

		public void ChangeOwner(Actor self, Player newOwner, int duration)
		{
			remaining = this.duration = duration;
			changingOwner = newOwner;
			self.ChangeOwner(newOwner);
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:6,代码来源:TemporaryOwnerManager.cs

示例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);
            });
        }
开发者ID:pchote,项目名称:OpenRA,代码行数:19,代码来源:ProximityCapturable.cs


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