當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。