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


C# AnimatedSprite.Load方法代码示例

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


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

示例1: GetAnimation

        /// <summary>
        /// Returns the proper animation for the given tile
        /// </summary>
        /// <param name="name">Name of the tile that needs to be animated</param>
        /// <returns></returns>
        private AnimatedSprite GetAnimation(string name)
        {
            string concatName = name.Substring(name.LastIndexOf('\\') + 1);
            AnimatedSprite newAnimation = new AnimatedSprite();

            wallEngine.colorScheme = concatName;

            switch (concatName)
            {
                case "Green":
                    if(mUseVert)
                        newAnimation.Load(mContent, "GreenVert", 4, 0.15f);
                    else newAnimation.Load(mContent, "GreenHor", 4, 0.15f);
                    mUseVert = !mUseVert;
                    break;
                case "Pink":
                    if(mUseVert)
                        newAnimation.Load(mContent, "PinkVert", 4, 0.15f);
                    else newAnimation.Load(mContent, "PinkHor", 4, 0.15f);
                    mUseVert = !mUseVert;
                    break;
                case "Blue":
                    if(mUseVert)
                        newAnimation.Load(mContent, "BlueVert", 4, 0.15f);
                    else newAnimation.Load(mContent, "BlueHor", 4, 0.15f);
                    mUseVert = !mUseVert;
                    break;
                case "Yellow":
                    if(mUseVert)
                        newAnimation.Load(mContent, "YellowVert", 4, 0.15f);
                    else newAnimation.Load(mContent, "YellowHor", 4, 0.15f);
                    mUseVert = !mUseVert;
                    break;
                case "Purple":
                    if(mUseVert)
                        newAnimation.Load(mContent, "PurpleVert", 4, 0.15f);
                    else newAnimation.Load(mContent, "PurpleHor", 4, 0.15f);
                    mUseVert = !mUseVert;
                    break;
                case "Orange":
                    if(mUseVert)
                        newAnimation.Load(mContent, "OrangeVert", 4, 0.15f);
                    else newAnimation.Load(mContent, "OrangeHor", 4, 0.15f);
                    mUseVert = !mUseVert;
                    break;
                case "GreenDiamond":
                    newAnimation.Load(mContent, "GreenDiamond", 3, 0.225f);
                    break;
                case "BlueDiamond":
                    newAnimation.Load(mContent, "BlueDiamond", 3, 0.225f);
                    break;
                case "OrangeDiamond":
                    newAnimation.Load(mContent, "OrangeDiamond", 3, 0.225f);
                    break;
                case "PinkDiamond":
                    newAnimation.Load(mContent, "PinkDiamond", 3, 0.225f);
                    break;
                case "PurpleDiamond":
                    newAnimation.Load(mContent, "PurpleDiamond", 3, 0.225f);
                    break;
                case "YellowDiamond":
                    newAnimation.Load(mContent, "YellowDiamond", 3, 0.225f);
                    break;
                case "BlueGem":
                    newAnimation.Load(mContent, "BlueGem", 6, 0.15f);
                    break;
                case "OrangeGem":
                    newAnimation.Load(mContent, "OrangeGem", 6, 0.15f);
                    break;
                case "PinkGem":
                    newAnimation.Load(mContent, "PinkGem", 6, 0.15f);
                    break;
                case "PurpleGem":
                    newAnimation.Load(mContent, "PurpleGem", 6, 0.15f);
                    break;
                case "GreenGem":
                    newAnimation.Load(mContent, "GreenGem", 6, 0.15f);
                    break;
                case "YellowGem":
                    newAnimation.Load(mContent, "YellowGem", 6, 0.15f);
                    break;
                default:
                    newAnimation.Load(mContent, "NoAnimation", 1, 0.5f);
                    break;
            }
            return newAnimation;
        }
开发者ID:billyboy429,项目名称:Gravity-Shift,代码行数:92,代码来源:Level.cs


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