當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。