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


C# Animation.PlayRepeating方法代码示例

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


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

示例1: GravityBomb

        public GravityBomb(GravityBombInfo info, ProjectileArgs args)
        {
            Args = args;
            altitude = args.srcAltitude;

            anim = new Animation(info.Image);
            if (anim.HasSequence("open"))
                anim.PlayThen("open", () => anim.PlayRepeating("idle"));
            else
                anim.PlayRepeating("idle");
        }
开发者ID:patthoyts,项目名称:OpenRA,代码行数:11,代码来源:GravityBomb.cs

示例2: GravityBomb

        public GravityBomb(GravityBombInfo info, ProjectileArgs args)
        {
            this.info = info;
            this.args = args;
            pos = args.Source;
            velocity = new WVec(WRange.Zero, WRange.Zero, -info.Velocity);

            anim = new Animation(info.Image);
            if (anim.HasSequence("open"))
                anim.PlayThen("open", () => anim.PlayRepeating("idle"));
            else
                anim.PlayRepeating("idle");
        }
开发者ID:Generalcamo,项目名称:OpenRA,代码行数:13,代码来源:GravityBomb.cs

示例3: Bullet

        public Bullet(BulletInfo info, ProjectileArgs args)
        {
            Info = info;
            Args = args;

            if (info.Inaccuracy > 0)
            {
                var factor = ((Args.dest - Args.src).ToCVec().Length) / args.weapon.Range;
                Args.dest += (PVecInt) (info.Inaccuracy * factor * args.firedBy.World.SharedRandom.Gauss2D(2)).ToInt2();
                Log.Write("debug", "Bullet with Inaccuracy; factor: #{0}; Projectile dest: {1}", factor, Args.dest);
            }

            if (Info.Image != null)
            {
                anim = new Animation(Info.Image, GetEffectiveFacing);
                anim.PlayRepeating("idle");
            }

            if (Info.ContrailLength > 0)
            {
                Trail = new ContrailHistory(Info.ContrailLength,
                    Info.ContrailUsePlayerColor ? ContrailHistory.ChooseColor(args.firedBy) : Info.ContrailColor,
                    Info.ContrailDelay);
            }
        }
开发者ID:Tsher,项目名称:OpenRA,代码行数:25,代码来源:Bullet.cs

示例4: Missile

        public Missile(MissileInfo info, ProjectileArgs args)
        {
            this.info = info;
            this.args = args;

            pos = args.Source;
            facing = args.Facing;

            targetPosition = args.PassiveTarget;

            // Convert ProjectileArg definitions to world coordinates
            // TODO: Change the yaml definitions so we don't need this
            var inaccuracy = (int)(info.Inaccuracy * 1024 / Game.CellSize);
            speed = info.Speed * 1024 / (5 * Game.CellSize);

            if (info.Inaccuracy > 0)
                offset = WVec.FromPDF(args.SourceActor.World.SharedRandom, 2) * inaccuracy / 1024;

            if (info.Image != null)
            {
                anim = new Animation(info.Image, () => facing);
                anim.PlayRepeating("idle");
            }

            if (info.ContrailLength > 0)
            {
                var color = info.ContrailUsePlayerColor ? ContrailRenderable.ChooseColor(args.SourceActor) : info.ContrailColor;
                trail = new ContrailRenderable(args.SourceActor.World, color, info.ContrailLength, info.ContrailDelay, 0);
            }
        }
开发者ID:TiriliPiitPiit,项目名称:OpenRA,代码行数:30,代码来源:Missile.cs

示例5: Missile

        public Missile(MissileInfo info, ProjectileArgs args)
        {
            this.info = info;
            this.args = args;

            pos = args.Source;
            facing = args.Facing;

            targetPosition = args.PassiveTarget;

            var world = args.SourceActor.World;

            if (world.SharedRandom.Next(100) <= info.LockOnProbability)
                lockOn = true;

            if (info.Inaccuracy.Range > 0)
            {
                var inaccuracy = OpenRA.Traits.Util.ApplyPercentageModifiers(info.Inaccuracy.Range, args.InaccuracyModifiers);
                offset = WVec.FromPDF(world.SharedRandom, 2) * inaccuracy / 1024;
            }

            if (info.Image != null)
            {
                anim = new Animation(world, info.Image, () => facing);
                anim.PlayRepeating("idle");
            }

            if (info.ContrailLength > 0)
            {
                var color = info.ContrailUsePlayerColor ? ContrailRenderable.ChooseColor(args.SourceActor) : info.ContrailColor;
                trail = new ContrailRenderable(world, color, info.ContrailLength, info.ContrailDelay, 0);
            }
        }
开发者ID:RobotCaleb,项目名称:OpenRA,代码行数:33,代码来源:Missile.cs

示例6: NukeLaunch

        public NukeLaunch(Player firedBy, string weapon, WPos launchPos, WPos targetPos, WDist velocity, int delay, bool skipAscent, string flashType)
        {
            this.firedBy = firedBy;
            this.weapon = weapon;
            this.delay = delay;
            this.turn = delay / 2;
            this.flashType = flashType;

            var offset = new WVec(WDist.Zero, WDist.Zero, velocity * turn);
            ascendSource = launchPos;
            ascendTarget = launchPos + offset;
            descendSource = targetPos + offset;
            descendTarget = targetPos;

            anim = new Animation(firedBy.World, weapon);
            anim.PlayRepeating("up");

            pos = launchPos;
            var weaponRules = firedBy.World.Map.Rules.Weapons[weapon.ToLowerInvariant()];
            if (weaponRules.Report != null && weaponRules.Report.Any())
                Sound.Play(weaponRules.Report.Random(firedBy.World.SharedRandom), pos);

            if (skipAscent)
                ticks = turn;
        }
开发者ID:rhamilton1415,项目名称:OpenRA,代码行数:25,代码来源:NukeLaunch.cs

示例7: NukeLaunch

        public NukeLaunch(Player firedBy, string name, WeaponInfo weapon, string weaponPalette, string upSequence, string downSequence,
			WPos launchPos, WPos targetPos, WDist velocity, int delay, bool skipAscent, string flashType)
        {
            this.firedBy = firedBy;
            this.weapon = weapon;
            this.weaponPalette = weaponPalette;
            this.downSequence = downSequence;
            this.delay = delay;
            turn = delay / 2;
            this.flashType = flashType;

            var offset = new WVec(WDist.Zero, WDist.Zero, velocity * turn);
            ascendSource = launchPos;
            ascendTarget = launchPos + offset;
            descendSource = targetPos + offset;
            descendTarget = targetPos;

            anim = new Animation(firedBy.World, name);
            anim.PlayRepeating(upSequence);

            pos = launchPos;
            if (weapon.Report != null && weapon.Report.Any())
                Game.Sound.Play(weapon.Report.Random(firedBy.World.SharedRandom), pos);

            if (skipAscent)
                ticks = turn;
        }
开发者ID:OpenRA,项目名称:OpenRA,代码行数:27,代码来源:NukeLaunch.cs

示例8: WithFire

 public WithFire(Actor self)
 {
     var rs = self.Trait<RenderSimple>();
     var roof = new Animation(rs.GetImage(self));
     roof.PlayThen("fire-start", () => roof.PlayRepeating("fire-loop"));
     rs.anims.Add( "fire", new RenderSimple.AnimationWithOffset( roof, () => new float2(7,-15), null ) { ZOffset = 24 } );
 }
开发者ID:patthoyts,项目名称:OpenRA,代码行数:7,代码来源:WithFire.cs

示例9: Parachute

        public Parachute(Actor cargo, WPos dropPosition)
        {
            this.cargo = cargo;

            parachutableInfo = cargo.Info.Traits.GetOrDefault<ParachutableInfo>();

            if (parachutableInfo != null)
                fallVector = new WVec(0, 0, parachutableInfo.FallRate);

            var parachuteSprite = parachutableInfo != null ? parachutableInfo.ParachuteSequence : null;
            if (parachuteSprite != null)
            {
                parachute = new Animation(cargo.World, parachuteSprite);
                parachute.PlayThen("open", () => parachute.PlayRepeating("idle"));
            }

            var shadowSprite = parachutableInfo != null ? parachutableInfo.ShadowSequence : null;
            if (shadowSprite != null)
            {
                shadow = new Animation(cargo.World, shadowSprite);
                shadow.PlayRepeating("idle");
            }

            if (parachutableInfo != null)
                parachuteOffset = parachutableInfo.ParachuteOffset;

            // Adjust x,y to match the target subcell
            cargo.Trait<IPositionable>().SetPosition(cargo, cargo.World.Map.CellContaining(dropPosition));
            var cp = cargo.CenterPosition;
            pos = new WPos(cp.X, cp.Y, dropPosition.Z);
        }
开发者ID:RobotCaleb,项目名称:OpenRA,代码行数:31,代码来源:Parachute.cs

示例10: Missile

        public Missile(MissileInfo info, ProjectileArgs args)
        {
            Info = info;
            Args = args;

            SubPxPosition = 1024 * Args.src;
            Altitude = Args.srcAltitude;
            Facing = Args.facing;

            if (info.Inaccuracy > 0)
                offset = (info.Inaccuracy * args.firedBy.World.SharedRandom.Gauss2D(2)).ToInt2();

            if (Info.Image != null)
            {
                anim = new Animation(Info.Image, () => Facing);
                anim.PlayRepeating("idle");
            }

            if (Info.ContrailLength > 0)
            {
                Trail = new ContrailHistory(Info.ContrailLength,
                    Info.ContrailUsePlayerColor ? ContrailHistory.ChooseColor(args.firedBy) : Info.ContrailColor,
                    Info.ContrailDelay);
            }
        }
开发者ID:kaott,项目名称:OpenRA,代码行数:25,代码来源:Missile.cs

示例11: Missile

        public Missile(MissileInfo info, ProjectileArgs args)
        {
            this.info = info;
            this.args = args;

            pos = args.Source;
            facing = args.Facing;

            targetPosition = args.PassiveTarget;

            if (info.Inaccuracy.Range > 0)
                offset = WVec.FromPDF(args.SourceActor.World.SharedRandom, 2) * info.Inaccuracy.Range / 1024;

            if (info.Image != null)
            {
                anim = new Animation(args.SourceActor.World, info.Image, () => facing);
                anim.PlayRepeating("idle");
            }

            if (info.ContrailLength > 0)
            {
                var color = info.ContrailUsePlayerColor ? ContrailRenderable.ChooseColor(args.SourceActor) : info.ContrailColor;
                trail = new ContrailRenderable(args.SourceActor.World, color, info.ContrailLength, info.ContrailDelay, 0);
            }
        }
开发者ID:RunCraze,项目名称:OpenRA,代码行数:25,代码来源:Missile.cs

示例12: GpsSatellite

        public GpsSatellite(World world, WPos pos)
        {
            this.pos = pos;

            anim = new Animation(world, "sputnik");
            anim.PlayRepeating("idle");
        }
开发者ID:gitTerebi,项目名称:OpenRA,代码行数:7,代码来源:GpsSatellite.cs

示例13: PowerdownIndicator

        public PowerdownIndicator(Actor a)
        {
            this.a = a;

            anim = new Animation(a.World, "poweroff");
            anim.PlayRepeating("offline");
        }
开发者ID:RobotCaleb,项目名称:OpenRA,代码行数:7,代码来源:PowerdownIndicator.cs

示例14: PowerdownIndicator

        public PowerdownIndicator(Actor a)
        {
            this.a = a;
            canPowerDown = a.Trait<CanPowerDown>();

            anim = new Animation(a.World, canPowerDown.Info.IndicatorImage);
            anim.PlayRepeating(canPowerDown.Info.IndicatorSequence);
        }
开发者ID:ushardul,项目名称:OpenRA,代码行数:8,代码来源:PowerdownIndicator.cs

示例15: NukeLaunch

 public NukeLaunch(Actor silo, string weapon, int2 targetLocation)
 {
     this.silo = silo;
     this.targetLocation = targetLocation;
     anim = new Animation("nuke");
     anim.PlayRepeating("up");
     pos = silo.CenterLocation;
 }
开发者ID:comradpara,项目名称:OpenRA,代码行数:8,代码来源:NukeLaunch.cs


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