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


C# Animation.HasSequence方法代码示例

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


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

示例1: NormalizeSequence

        public static string NormalizeSequence(Animation anim, DamageState state, string sequence)
        {
            var states = new Pair<DamageState, string>[]
            {
                Pair.New(DamageState.Critical, "critical-"),
                Pair.New(DamageState.Heavy, "damaged-"),
                Pair.New(DamageState.Medium, "scratched-"),
                Pair.New(DamageState.Light, "scuffed-")
            };

            // Remove existing damage prefix
            foreach (var s in states)
            {
                if (sequence.StartsWith(s.Second))
                {
                    sequence = sequence.Substring(s.Second.Length);
                    break;
                }
            }

            foreach (var s in states)
                if (state >= s.First && anim.HasSequence(s.Second + sequence))
                    return s.Second + sequence;

            return sequence;
        }
开发者ID:ushardul,项目名称:OpenRA,代码行数:26,代码来源:RenderSprites.cs

示例2: 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

示例3: NormalizeSequence

        public static string NormalizeSequence(Animation anim, DamageState state, string sequence)
        {
            // Remove any existing damage prefix
            sequence = UnnormalizeSequence(sequence);

            foreach (var s in DamagePrefixes)
                if (state >= s.First && anim.HasSequence(s.Second + sequence))
                    return s.Second + sequence;

            return sequence;
        }
开发者ID:pchote,项目名称:OpenRA,代码行数:11,代码来源:RenderSprites.cs

示例4: 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

示例5: NormalizeSequence

        public static string NormalizeSequence(Animation anim, DamageState state, string baseSequence)
        {
            var states = new Pair<DamageState, string>[]
            {
                Pair.New(DamageState.Critical, "critical-"),
                Pair.New(DamageState.Heavy, "damaged-"),
                Pair.New(DamageState.Medium, "scratched-"),
                Pair.New(DamageState.Light, "scuffed-")
            };

            foreach (var s in states)
                if (state >= s.First && anim.HasSequence(s.Second+baseSequence))
                    return s.Second+baseSequence;

            return baseSequence;
        }
开发者ID:TiriliPiitPiit,项目名称:OpenRA,代码行数:16,代码来源:RenderSprites.cs

示例6: Parachute

        public Parachute(Player owner, float2 location, int altitude, Actor cargo)
        {
            this.location = location;
            this.altitude = altitude;
            this.cargo = cargo;

            var rs = cargo.Trait<RenderSimple>();
            var image = rs.anim.Name;
            palette = rs.Palette(owner);

            anim = new Animation(image);
            if (anim.HasSequence("idle"))
                anim.PlayFetchIndex("idle", () => 0);
            else
                anim.PlayFetchIndex("stand", () => 0);
            anim.Tick();

            paraAnim = new Animation("parach");
            paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));
        }
开发者ID:katzsmile,项目名称:OpenRA,代码行数:20,代码来源:Parachute.cs

示例7: Parachute

        public Parachute(Player owner, PPos location, int altitude, Actor cargo)
        {
            this.location = location;
            this.altitude = altitude;
            this.cargo = cargo;

            var rs = cargo.Trait<RenderSimple>();
            var image = rs.anim.Name;
            palette = rs.Palette(owner);

            anim = new Animation(image);
            if (anim.HasSequence("idle"))
                anim.PlayFetchIndex("idle", () => 0);
            else
                anim.PlayFetchIndex("stand", () => 0);
            anim.Tick();

            var pai = cargo.Info.Traits.GetOrDefault<ParachuteAttachmentInfo>();

            paraAnim = new Animation(pai != null ? pai.ParachuteSprite : "parach");
            paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));

            if (pai != null) offset = pai.Offset;
        }
开发者ID:JamesDunne,项目名称:OpenRA,代码行数:24,代码来源:Parachute.cs


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