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


C# AnimationType类代码示例

本文整理汇总了C#中AnimationType的典型用法代码示例。如果您正苦于以下问题:C# AnimationType类的具体用法?C# AnimationType怎么用?C# AnimationType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Attack

    /// <summary>
    /// Perform an animation of the given type and index. No animation will be played if the animation
    /// is not present. The index given is the index of the animation in the array specified on the 
    /// prefab, not the index of the animation out of all the animations
    /// </summary>
    /// <param name="type">The type of animation to play</param>
    /// <param name="index">The index of the animation</param>
    public void Attack(AnimationType type, int index)
    {
        AnimationClip[] animations;

        switch (type)
        {
            case AnimationType.Spell:
                animations = _spellAnimations;
                break;

            case AnimationType.Misc:
                animations = _miscAnimations;
                break;

            default:
                animations = _meleeAnimations;
                break;
        }

        try
        {
            animation.Play(animations[index].name);
        }

        catch
        {
            Debug.LogWarning("There is no " + type + " animation " + "indexed at " + index + ".");
        }
    }
开发者ID:peachesandcorn,项目名称:CMPS427,代码行数:36,代码来源:AnimationController.cs

示例2: Animation

 public Animation(EpicModel epicModel, AnimationType animationType)
 {
     _epicModel = epicModel;
     AnimationType = animationType;
     _keyframes = new List<Keyframe>(10);
     _ignoredModelParts = new List<ModelPart>();
 }
开发者ID:HaKDMoDz,项目名称:Psy,代码行数:7,代码来源:Animation.cs

示例3: CreateAnimation

        public Animation CreateAnimation(AnimationType animationName, IndexPair startLocation)
        {
            switch (animationName)
            {
                case AnimationType.PlayerAnimation:
                    temp = new PlayerAnimation();
                    break;

                case AnimationType.MonsterAnimation:
                    temp = new MonsterAnimation(); // new MonsterAnimation();
                    temp.AddCollider();
                    //((MonsterAnimation)temp).Collider = new Collider(((MonsterAnimation)temp));
                    break;
                // The animation point will be set when its requested from the pool
                case AnimationType.BulletAnimation:
                    temp = new BulletAnimation();
                    temp.AddCollider();
                    //((BulletAnimation)temp).Collider = new Collider(((BulletAnimation)temp));
                    break;
                // The animation point will be set when its requested from the pool
                case AnimationType.ExplosionAnimation:
                    temp = new ExplosionAnimation();
                    break;

                default:
                    return null;
            }
            return temp;
        }
开发者ID:amrufathy,项目名称:EscapeRunner,代码行数:29,代码来源:AnimationFactory.cs

示例4: CreateEmpyAnimation

        public static Animation CreateEmpyAnimation(AnimationType animationName)
        {
            IndexPair startLocation = new IndexPair(0, 0);
            switch (animationName)
            {
                case AnimationType.PlayerAnimation:
                    temp = new PlayerAnimation();
                    temp.AddCollider();
                    break;

                case AnimationType.MonsterAnimation:
                    temp = new MonsterAnimation(); // new MonsterAnimation();
                    temp.AddCollider();
                    //((MonsterAnimation)temp).Collider = new Collider(((MonsterAnimation)temp));
                    break;
                // The animation point will be set when its requested from the pool
                case AnimationType.BulletAnimation:

                    temp = new BulletAnimation();
                    temp.AddCollider();
                    //((BulletAnimation)temp).Collider = new Collider(((BulletAnimation)temp));
                    break;
                // The animation point will be set when its requested from the pool
                case AnimationType.ExplosionAnimation:
                    temp = new ExplosionAnimation();
                    temp.Collider = new Collider(temp, System.Drawing.Rectangle.Empty);
                    break;

                default:
                    return null;
            }
            return temp;
        }
开发者ID:amrufathy,项目名称:EscapeRunner,代码行数:33,代码来源:AnimationFactory.cs

示例5: Create

 public static AnimationTimeline Create(AnimationType type, object oldValue, object newValue, TimeSpan duration, TimeSpan beginTime, double acceleration, double deceleration)
 {
     switch (type)
     {
         case AnimationType.DoubleAnimation:
             if (oldValue != null)
                 return new DoubleAnimation((double)oldValue, (double)newValue, duration) { BeginTime = beginTime, AccelerationRatio = acceleration, DecelerationRatio = deceleration };
             else
                 return new DoubleAnimation((double)newValue, duration) { BeginTime = beginTime, AccelerationRatio = acceleration, DecelerationRatio = deceleration };
         case AnimationType.ColorAnimation:
             if (newValue is Color)
             {
                 if (oldValue != null)
                     return new ColorAnimation((Color)oldValue, (Color)newValue, duration) { BeginTime = beginTime, AccelerationRatio = acceleration, DecelerationRatio = deceleration };
                 else
                     return new ColorAnimation((Color)newValue, duration) { BeginTime = beginTime, AccelerationRatio = acceleration, DecelerationRatio = deceleration };
             }
             else
             {
                 if (oldValue != null)
                     return new ColorAnimation((Color)oldValue, (Color)ColorConverter.ConvertFromString(newValue as string), duration) { BeginTime = beginTime, AccelerationRatio = acceleration, DecelerationRatio = deceleration };
                 else
                     return new ColorAnimation((Color)ColorConverter.ConvertFromString(newValue as string), duration) { BeginTime = beginTime, AccelerationRatio = acceleration, DecelerationRatio = deceleration };
             }
         case AnimationType.ThicknessAnimation:
             if (oldValue != null)
                 return new ThicknessAnimation((Thickness)oldValue, (Thickness)newValue, duration) { BeginTime = beginTime, AccelerationRatio = acceleration, DecelerationRatio = deceleration };
             else
                 return new ThicknessAnimation((Thickness)newValue, duration) { BeginTime = beginTime, AccelerationRatio = acceleration, DecelerationRatio = deceleration };
         default:
             return null;
     }
 }
开发者ID:RicoAcuzar,项目名称:SysAd-Project,代码行数:33,代码来源:AnimationFactory.cs

示例6: AnimatedGraphics

        /// <summary>
        /// Loads an animated graphics. The descriptor file for the animation must be
        /// in the "animations" folder.
        /// </summary>
        /// <param name="animationName">The name of the animation.</param>
        /// <param name="game"></param>
        public AnimatedGraphics(string animationName, Game game)
        {
            PropertyReader props = game.loader.GetPropertyReader().Select("animations/" + animationName + ".xml");
            foreach (PropertyReader group in props.SelectAll("group")) {
                Animation current = new Animation();
                string[] animName = group.GetString("name").Split('.');
                string type = animName[0];
                Sprite.Dir dir = (Sprite.Dir)Enum.Parse(typeof(Sprite.Dir), animName[1], true);
                AnimationType animType = new AnimationType(type, dir);
                List<Frame> frames = new List<Frame>();
                foreach (PropertyReader frameProp in group.SelectAll("frame")) {
                    Frame frame = new Frame();
                    frame.id = frameProp.GetInt("sheetid");
                    frame.time = frameProp.GetInt("time");
                    frames.Add(frame);
                }
                current.frames = frames.ToArray();
                animations.Add(animType, current);
                if (this.currentAnimation == null) {
                    this.currentAnimation = current;
                    this.currentType = animType;
                }
            }
            LoadSpriteSheet(props.GetString("sheet"), game);

            if (currentAnimation == null) {
                throw new Game.SettingsException(string.Format("Animation descriptor file \"{0}.xml\" does not contain animation!", animationName));
            }
            this.frame = 0;
            CalculateRows();
        }
开发者ID:hgabor,项目名称:kfirpgcreator,代码行数:37,代码来源:AnimatedGraphics.cs

示例7: SpellObject

 public SpellObject(
     uint ID, 
     uint Count,            
     uint OverlayFileRID,
     uint NameRID, 
     uint Flags,
     ushort LightFlags, 
     byte LightIntensity, 
     ushort LightColor, 
     AnimationType FirstAnimationType, 
     byte ColorTranslation, 
     byte Effect, 
     Animation Animation, 
     BaseList<SubOverlay> SubOverlays,                      
     byte TargetsCount,
     SchoolType SchoolType)
     : base(ID, Count, 
         OverlayFileRID, NameRID, Flags, 
         LightFlags, LightIntensity, LightColor, 
         FirstAnimationType, ColorTranslation, Effect, 
         Animation, SubOverlays)
 {
     this.targetsCount = TargetsCount;
     this.schoolType = SchoolType;
 }
开发者ID:AlgorithmsOfMathdestruction,项目名称:meridian59-dotnet,代码行数:25,代码来源:SpellObject.cs

示例8: PlayAnimation

 //애니메이션을 재생합니다.
 public void PlayAnimation(AnimationType anim) {
     m_current = anim;
     
     //초밥 종류에 따라서 애니메이션을 지정합니다.
     string animName = m_sushiType.ToString() + "_" + m_current.ToString();
     m_animation.Play(animName);
 }
开发者ID:fotoco,项目名称:006772,代码行数:8,代码来源:Sushi.cs

示例9: GetContinuumAnimation

        public AnimatorHelperBase GetContinuumAnimation(FrameworkElement element, AnimationType animationType)
        {
            TextBlock nameText;

            if (element is TextBlock)
                nameText = element as TextBlock;
            else
                nameText = element.GetVisualDescendants().OfType<TextBlock>().FirstOrDefault();

            if (nameText != null)
            {
                if (animationType == AnimationType.NavigateForwardIn)
                {
                    return new ContinuumForwardInAnimator() { RootElement = nameText, LayoutRoot = AnimationContext };
                }
                if (animationType == AnimationType.NavigateForwardOut)
                {
                    return new ContinuumForwardOutAnimator() { RootElement = nameText, LayoutRoot = AnimationContext };
                }
                if (animationType == AnimationType.NavigateBackwardIn)
                {
                    return new ContinuumBackwardInAnimator() { RootElement = nameText, LayoutRoot = AnimationContext };
                }
                if (animationType == AnimationType.NavigateBackwardOut)
                {
                    return new ContinuumBackwardOutAnimator() { RootElement = nameText, LayoutRoot = AnimationContext };
                }
            }
            return null;
        }
开发者ID:torifat,项目名称:C0nv3rt3r,代码行数:30,代码来源:AnimatedBasePage.cs

示例10: StartAnimation

 public void StartAnimation(AnimationType animType)
 {
     switch (animType) {
             case AnimationType.rotate:
                     StartRotate ();
                     break;
             case AnimationType.rotateY:
                     StartRotateY ();
                     break;
             case AnimationType.move:
                     StartMoveAdd ();
                     break;
             case AnimationType.punchscale:
                     StartPunchScale (new Vector3 (1, 1, 1));
                     break;
             case AnimationType.linerotate:
                     StartRotateLine ();
                     break;
             case AnimationType.linerotateY:
                     StartRotateLineY ();
                     break;
             case AnimationType.movefrom:
                     StartMoveFrom ();
                     break;
             default:
                     return;
                     break;
             }
 }
开发者ID:thuskey,项目名称:ARCard,代码行数:29,代码来源:iTweenAnimation.cs

示例11: CreateGameObject

		/// <summary>
		/// GameObjectを作成する
		/// </summary>
		/// <param name='format'>内部形式データ</param>
		/// <param name='use_rigidbody'>剛体を使用するか</param>
		/// <param name='animation_type'>アニメーションタイプ</param>
		/// <param name='use_ik'>IKを使用するか</param>
		/// <param name='scale'>スケール</param>
		public static GameObject CreateGameObject(PMXFormat format, bool use_rigidbody, AnimationType animation_type, bool use_ik, float scale) {
			GameObject result;
			using (PMXConverter converter = new PMXConverter()) {
				result = converter.CreateGameObject_(format, use_rigidbody, animation_type, use_ik, scale);
			}
			return result;
		}
开发者ID:leonpardlee,项目名称:mmd-for-unity,代码行数:15,代码来源:PMXConverter.cs

示例12: Create

    public void Create(string name, AnimationType animationType, int frames, int rows, int columns, Vector2 firstFrameStart, float tilingX, float tilingY)
    {
        _name = name;
        _animationType = animationType;
        _frames = frames;
        _rows = rows;
        _columns = columns;
        _firstFrameStart = firstFrameStart;
        _tilingX = tilingX;
        _tilingY = tilingY;

        _currentFrame = 2;
        int frameCounter = 0;

        _spriteInfo = new Hashtable();

        for (int row = 0; row < rows; row++)
        {
            for (int column = 0; column < columns; column++)
            {
                frameCounter++;

                Vector2 frameCoords = new Vector2();

                frameCoords.x = firstFrameStart.x + ( tilingX * (float)column );
                frameCoords.y = firstFrameStart.y + (  tilingY * (float)row );

                _spriteInfo.Add(frameCounter, frameCoords);
            }
        }
    }
开发者ID:ZehrBear,项目名称:SeniorProject,代码行数:31,代码来源:PlayerSpriteData.cs

示例13: Animate

        /// <summary>
        /// Returns the appropriate function given the
        /// requested animation type
        /// </summary>
        /// <param name="time"></param>
        /// <param name="startingPoint"></param>
        /// <param name="change"></param>
        /// <param name="animationTime"></param>
        /// <param name="animType"></param>
        /// <returns></returns>
        public static double Animate(double time, double startingPoint, double change, double animationTime, AnimationType animType)
        {
            // If the animation is complete
            // Return the destination to avoid overshoot
            if (time > animationTime)
            {
                return startingPoint + change;
            }

            switch (animType)
            {
                case AnimationType.Linear:
                    return Linear(time, startingPoint, change, animationTime);
                case AnimationType.QuadraticIn:
                    return QuadraticIn(time, startingPoint, change, animationTime);
                case AnimationType.QuadraticOut:
                    return QuadraticOut(time, startingPoint, change, animationTime);
                case AnimationType.QuadraticInOut:
                    return QuadraticInOut(time, startingPoint, change, animationTime);
                case AnimationType.CubicIn:
                    return CubicIn(time, startingPoint, change, animationTime);
                case AnimationType.CubicOut:
                    return CubicOut(time, startingPoint, change, animationTime);
                case AnimationType.CubicInOut:
                    return CubicInOut(time, startingPoint, change, animationTime);
                case AnimationType.QuarticIn:
                    return QuarticIn(time, startingPoint, change, animationTime);
                case AnimationType.QuarticOut:
                    return QuarticOut(time, startingPoint, change, animationTime);
                case AnimationType.QuarticInOut:
                    return QuarticInOut(time, startingPoint, change, animationTime);
                case AnimationType.QuinticIn:
                    return QuinticIn(time, startingPoint, change, animationTime);
                case AnimationType.QuinticOut:
                    return QuinticOut(time, startingPoint, change, animationTime);
                case AnimationType.QuinticInOut:
                    return QuinticInOut(time, startingPoint, change, animationTime);
                case AnimationType.SinIn:
                    return SinIn(time, startingPoint, change, animationTime);
                case AnimationType.SinOut:
                    return SinOut(time, startingPoint, change, animationTime);
                case AnimationType.SinInOut:
                    return SinInOut(time, startingPoint, change, animationTime);
                case AnimationType.ExpIn:
                    return ExpIn(time, startingPoint, change, animationTime);
                case AnimationType.ExpOut:
                    return ExpOut(time, startingPoint, change, animationTime);
                case AnimationType.ExpInOut:
                    return ExpInOut(time, startingPoint, change, animationTime);
                case AnimationType.CircIn:
                    return CircIn(time, startingPoint, change, animationTime);
                case AnimationType.CircOut:
                    return CircOut(time, startingPoint, change, animationTime);
                case AnimationType.CircInOut:
                    return CircInOut(time, startingPoint, change, animationTime);
                default:
                    throw new Exception("An Invalid Enum was given");
            }
        }
开发者ID:DevHalo,项目名称:CStrike2D,代码行数:69,代码来源:EasingFunctions.cs

示例14: Settings

		public Settings (bool automaticChange, bool onlyFavorites, bool randomOrder, double changeInterval, AnimationType animationType)
		{
			AutomaticChange = automaticChange;
			OnlyFavorites = onlyFavorites;
			RandomOrder = randomOrder;
			ChangeInterval = changeInterval;
			AnimationType = animationType;			
		}
开发者ID:Sibcat,项目名称:Slideshow,代码行数:8,代码来源:Settings.cs

示例15: Setup

	public virtual void Setup(AnimationType animType)
	{
		_rectTransform = GetComponent<RectTransform>();
		_canvas = GetComponent<Canvas>();
		
		_animationType = animType;
		gameObject.SetActive(false);
	}
开发者ID:warrussell,项目名称:ggj2016,代码行数:8,代码来源:GameScreen.cs


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