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


C# Actor.IsDisabled方法代码示例

本文整理汇总了C#中Actor.IsDisabled方法的典型用法代码示例。如果您正苦于以下问题:C# Actor.IsDisabled方法的具体用法?C# Actor.IsDisabled怎么用?C# Actor.IsDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Actor的用法示例。


在下文中一共展示了Actor.IsDisabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreatesShroud

 public CreatesShroud(Actor self, CreatesShroudInfo info)
     : base(self, info)
 {
     addCellsToPlayerShroud = (p, uv) => p.Shroud.AddProjectedShroudGeneration(self, uv);
     removeCellsFromPlayerShroud = p => p.Shroud.RemoveShroudGeneration(self);
     isDisabled = () => self.IsDisabled();
 }
开发者ID:rhamilton1415,项目名称:OpenRA,代码行数:7,代码来源:CreatesShroud.cs

示例2:

		void ITick.Tick(Actor self)
		{
			var disabled = self.IsDisabled();

			if (cachedDisabled != disabled)
			{
				Game.Sound.Play(disabled ? Info.DisableSound : Info.EnableSound, self.CenterPosition);
				desiredRange = disabled ? WDist.Zero : Info.Range;
				desiredVRange = disabled ? WDist.Zero : Info.MaximumVerticalOffset;
				cachedDisabled = disabled;
			}

			if (self.CenterPosition != cachedPosition || desiredRange != cachedRange || desiredVRange != cachedVRange)
			{
				cachedPosition = self.CenterPosition;
				cachedRange = desiredRange;
				cachedVRange = desiredVRange;
				self.World.ActorMap.UpdateProximityTrigger(proximityTrigger, cachedPosition, cachedRange, cachedVRange);
			}

			if (--ticks < 0)
			{
				GrantBounty();

				ticks = Info.Delay;
			}
		}
开发者ID:GraionDilach,项目名称:OpenRA.Mods.AS,代码行数:27,代码来源:ProximityBounty.cs

示例3: Tick

			public override Activity Tick(Actor self)
			{
				if (IsCanceled || !target.IsValidFor(self))
					return NextActivity;

				if (self.IsDisabled())
					return this;

				var weapon = attack.ChooseArmamentForTarget(target);
				if (weapon != null)
				{
					var targetIsMobile = (target.Type == TargetType.Actor && target.Actor.HasTrait<IMove>())
						|| (target.Type == TargetType.FrozenActor && target.FrozenActor.Info.Traits.Contains<IMove>());

					// Try and sit at least one cell closer than the max range to give some leeway if the target starts moving.
					var maxRange = targetIsMobile ? new WRange(Math.Max(weapon.Weapon.MinRange.Range, weapon.Weapon.Range.Range - 1024))
						: weapon.Weapon.Range;

					attack.Target = target;

					if (move != null)
						return Util.SequenceActivities(move.MoveFollow(self, target, weapon.Weapon.MinRange, maxRange), this);
				}

				return NextActivity;
			}
开发者ID:JackKucan,项目名称:OpenRA,代码行数:26,代码来源:AttackFollow.cs

示例4: Tick

			public override Activity Tick(Actor self)
			{
				if (IsCanceled || !target.IsValidFor(self))
					return NextActivity;

				if (self.IsDisabled())
					return this;

				var weapon = attack.ChooseArmamentsForTarget(target, forceAttack).FirstOrDefault();
				if (weapon != null)
				{
					var targetIsMobile = (target.Type == TargetType.Actor && target.Actor.Info.HasTraitInfo<IMoveInfo>())
						|| (target.Type == TargetType.FrozenActor && target.FrozenActor.Info.HasTraitInfo<IMoveInfo>());

					// Try and sit at least one cell closer than the max range to give some leeway if the target starts moving.
					var modifiedRange = weapon.MaxRange();
					var maxRange = targetIsMobile ? new WDist(Math.Max(weapon.Weapon.MinRange.Length, modifiedRange.Length - 1024))
						: modifiedRange;

					attack.Target = target;

					if (move != null)
						return Util.SequenceActivities(move.MoveFollow(self, target, weapon.Weapon.MinRange, maxRange), this);
				}

				return NextActivity;
			}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:27,代码来源:AttackFollow.cs

示例5: ModifyRender

 public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)
 {
     var disabled = self.IsDisabled();
     foreach (var a in r)
     {
         var ret = a.WithPos(a.Pos - Info.Origin);
         yield return ret;
         if (disabled)
             yield return ret.WithPalette("disabled").WithZOffset(1);
     }
 }
开发者ID:Iran,项目名称:ClassicRA,代码行数:11,代码来源:RenderBuilding.cs

示例6: Tick

        public void Tick(Actor self)
        {
            if (lobbyShroudFogDisabled)
                return;

            var disabled = self.IsDisabled();
            if (cachedLocation != self.Location || cachedDisabled != disabled)
            {
                cachedLocation = self.Location;
                cachedDisabled = disabled;
                Shroud.UpdateShroudGeneration(self.World.Players.Select(p => p.Shroud), self);
            }
        }
开发者ID:ushardul,项目名称:OpenRA,代码行数:13,代码来源:CreatesShroud.cs

示例7: Tick

        public void Tick(Actor self)
        {
            var disabled = self.IsDisabled();

            if (cachedDisabled != disabled)
            {
                Sound.Play(disabled ? info.DisableSound : info.EnableSound, self.CenterPosition);
                desiredRange = disabled ? WDist.Zero : info.Range;
                cachedDisabled = disabled;
            }

            if (self.CenterPosition != cachedPosition || desiredRange != cachedRange)
            {
                cachedPosition = self.CenterPosition;
                cachedRange = desiredRange;
                self.World.ActorMap.UpdateProximityTrigger(proximityTrigger, cachedPosition, cachedRange);
            }
        }
开发者ID:rhamilton1415,项目名称:OpenRA,代码行数:18,代码来源:UpgradeActorsNear.cs

示例8: CanAttack

		protected virtual bool CanAttack(Actor self, Target target)
		{
			if (!self.IsInWorld)
				return false;

			// Building is under construction or is being sold
			if (building.Value != null && !building.Value.BuildComplete)
				return false;

			if (!target.IsValidFor(self))
				return false;

			if (Armaments.All(a => a.IsReloading))
				return false;

			if (self.IsDisabled())
				return false;

			return true;
		}
开发者ID:Berzeger,项目名称:OpenRA,代码行数:20,代码来源:AttackBase.cs

示例9: UnitProducedByOther

        public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
        {
            // If the produced Actor doesn't occupy space, it can't be in range
            if (produced.OccupiesSpace == null)
                return;

            // We don't grant upgrades when disabled
            if (self.IsDisabled())
                return;

            // Work around for actors produced within the region not triggering until the second tick
            if ((produced.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= info.Range.LengthSquared)
            {
                var stance = self.Owner.Stances[produced.Owner];
                if (!info.ValidStances.HasStance(stance))
                    return;

                var um = produced.TraitOrDefault<UpgradeManager>();
                if (um != null)
                    foreach (var u in info.Upgrades)
                        if (um.AcknowledgesUpgrade(produced, u))
                            um.GrantTimedUpgrade(produced, u, 1);
            }
        }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:24,代码来源:UpgradeActorsNear.cs

示例10: CanAttack

        protected virtual bool CanAttack(Actor self, Target target)
        {
            if (!self.IsInWorld)
                return false;

            if (!target.IsValidFor(self))
                return false;

            if (Armaments.All(a => a.IsReloading))
                return false;

            if (self.IsDisabled())
                return false;

            return true;
        }
开发者ID:Generalcamo,项目名称:OpenRA,代码行数:16,代码来源:AttackBase.cs

示例11: Tick

            public override Activity Tick(Actor self)
            {
                if (IsCanceled || !target.IsValidFor(self))
                    return NextActivity;

                if (self.IsDisabled())
                    return this;

                const int RangeTolerance = 1;	/* how far inside our maximum range we should try to sit */
                var weapon = attack.ChooseArmamentForTarget(target);

                if (weapon != null)
                {
                    var range = WRange.FromCells(Math.Max(0, weapon.Weapon.Range.Range / 1024 - RangeTolerance));

                    attack.Target = target;

                    if (move != null)
                        return Util.SequenceActivities(move.MoveFollow(self, target, range), this);
                }

                return NextActivity;
            }
开发者ID:RunCraze,项目名称:OpenRA,代码行数:23,代码来源:AttackFollow.cs

示例12: CanAttack

        protected virtual bool CanAttack(Actor self, Target target)
        {
            if (!self.IsInWorld) return false;
            if (!target.IsValid) return false;
            if (Weapons.All(w => w.IsReloading)) return false;
            if (self.IsDisabled()) return false;

            if (target.IsActor && target.Actor.HasTrait<ITargetable>() &&
                !target.Actor.Trait<ITargetable>().TargetableBy(target.Actor,self))
                return false;

            return true;
        }
开发者ID:JamesDunne,项目名称:OpenRA,代码行数:13,代码来源:AttackBase.cs

示例13: IsDisabled

		protected override bool IsDisabled(Actor self) { return self.IsDisabled(); }
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:1,代码来源:CreatesShroud.cs

示例14: Tick

        public void Tick(Actor self)
        {
            if (remainingTime > 0 && canCloak)
                if (--remainingTime <= 0)
                    Sound.Play(info.CloakSound, self.CenterLocation);
            if (self.IsDisabled())
                Uncloak();

            if (info.UncloakOnMove && (lastPos == null || lastPos.Value != self.Location))
            {
                Uncloak();
                lastPos = self.Location;
            }
        }
开发者ID:Tsher,项目名称:OpenRA,代码行数:14,代码来源:Cloak.cs

示例15: Tick

        public void Tick(Actor self)
        {
            if (disabled)
                return;

            if (remainingTime > 0 && !disabled && !damageDisabled && --remainingTime <= 0)
                Sound.Play(Info.CloakSound, self.CenterPosition);

            if (self.IsDisabled())
                Uncloak();

            if (Info.UncloakOnMove && (lastPos == null || lastPos.Value != self.Location))
            {
                Uncloak();
                lastPos = self.Location;
            }
        }
开发者ID:RobotCaleb,项目名称:OpenRA,代码行数:17,代码来源:Cloak.cs


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