• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# AnimationState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Start

 // Use this for initialization
 void Start()
 {
     m_RootRef = gameObject;
     m_TransformRef = new TransformCache(m_RootRef.transform);
     m_ScaleFactor = (-m_RootRef.transform.localScale.x) / m_RootRef.transform.localScale.x;
     m_State = AnimationState.Idle;
 }
开发者ID:NDark,项目名称:crushpiec,代码行数:8,代码来源:TransformAnimation.cs


示例2: OnEnable

 void OnEnable()
 {
     MyAnimation = MyTransform.GetComponent<Animation>();
     MyAnimation.wrapMode = MyWarpMode;
     MyAnimationState = MyAnimation[MyAnimation.animation.clip.name];
     MyAnimationStateTime = 0.0f;
 }
开发者ID:BBJV,项目名称:camachi,代码行数:7,代码来源:MyPlayAnimation.cs


示例3: Animator

 /// <summary>
 /// Constructor that specifies a starting state for the animation
 /// </summary>
 /// <param name="startingState">Only Showing or Hiding should be used</param>
 public Animator(UserControl animateControl, AnimationState startingState)
 {
     InitializeTimer();
     animatedControl = animateControl;
     state = startingState;
     tmrAnimate.Start();
 }
开发者ID:WillVandergrift,项目名称:Carputer,代码行数:11,代码来源:Animator.cs


示例4: ChangeAnimationState

 public void ChangeAnimationState(AnimationState _NextState, float _DelayTime, bool _RestoreTransform = false)
 {
     if (m_NextState != _NextState) {
         m_NextState = _NextState;
         StartCoroutine(PerformChangeAnimationState(_NextState, _DelayTime, _RestoreTransform));
     }
 }
开发者ID:NDark,项目名称:crushpiec,代码行数:7,代码来源:TransformAnimation.cs


示例5: Start

    // Use this for initialization
    void Start()
    {
        animation.Stop();

        // By default loop all animations
        animation.wrapMode = WrapMode.Loop;

        // Jump animation are in a higher layer:
        // Thus when a jump animation is playing it will automatically override all other animations until it is faded out.
        // This simplifies the animation script because we can just keep playing the walk / run / idle cycle without having to spcial case jumping animations.
        int jumpingLayer = 1;
        AnimationState jump = animation["jump"];
        jump.layer = jumpingLayer;
        jump.speed *= jumpAnimationSpeedModifier;
        jump.wrapMode = WrapMode.Once;

        AnimationState jumpFall = animation["jumpFall"];
        jumpFall.layer = jumpingLayer;
        jumpFall.wrapMode = WrapMode.ClampForever;

        AnimationState jumpLand = animation["jumpLand"];
        jumpLand.layer = jumpingLayer;
        jumpLand.speed *= jumpLandAnimationSpeedModifier;
        jumpLand.wrapMode = WrapMode.Once;

        //AnimationState buttStomp = animation["buttStomp"];

        run = animation["run"];
        run.speed *= runAnimationSpeedModifier;

        AnimationState walk = animation["walk"];
        walk.speed *= walkAnimationSpeedModifier;
    }
开发者ID:NemOry,项目名称:EscapeTheNemories,代码行数:34,代码来源:TimothyAnimation.cs


示例6: Update

        public virtual void Update(GameTime gameTime)
        {
            //_Sprite.Update(gameTime);

            if (_AnimationState == AnimationState.Waiting)
            {
                if (_AnimationDelayCount >= _AnimationDelayInterval)
                    PreAnimation();
            }
            else if (_AnimationState == AnimationState.Animate)
            {
                StartSiblingAnimations(FireTime.AtStart);
                if (_AnimationDelayCount < _AnimationDelayInterval)
                    _AnimationDelayCount += gameTime.ElapsedGameTime.Milliseconds;
                else
                {
                    if (_AnimationCount < _AnimationInterval)
                    {
                        _AnimationCount = MathHelper.Clamp(_AnimationCount + gameTime.ElapsedGameTime.Milliseconds, 0, _AnimationInterval);
                        AnimationLogic();
                    }
                    else
                    {
                        PostAnimation();
                        _AnimationState = AnimationState.End;
                        StartSiblingAnimations(FireTime.AtEnd);
                    }
                }
            }
        }
开发者ID:Toan-Anh,项目名称:Triple-Triad,代码行数:30,代码来源:SpriteAnimation_Base.cs


示例7: CrossfadeAnimation

    //    
    public void CrossfadeAnimation(AnimationState state, float fadeTime)
    {
        // ** This function is exactly like the Unity Animation.Crossfade() method
        //
        if (currentState == state)
            return;
        animationFadeTime = fadeTime;

        for (int i = 0; i < fadingStates.Count; i++) {
            if (state.name == fadingStates[i].name) {
                fadingStates.RemoveAt (i);
                if (currentState != null)
                    fadingStates.Add (currentState);
                currentState = state;
                return;
            }
        }
        //
        if (currentState != null)
            fadingStates.Add (currentState);
        //
        currentState = state;
        currentState.weight = 0;
        currentState.time = currentStateTime = 0;
        currentState.enabled = true;
        //
    }
开发者ID:VirsixInc,项目名称:VRCubeSword,代码行数:28,代码来源:AnimationController.cs


示例8: Update

 void Update()
 {
     if (Input.GetButton("Fire3"))
     {
         animationState = AnimationState.Falling;
     }
     switch (animationState)
     {
         case AnimationState.NotAnimated:
             break;
         case AnimationState.Falling:
             FallDown();
             break;
         case AnimationState.LayingDown:
             float vertical = CrossPlatformInputManager.GetAxis("Vertical");
             if (vertical != 0)
             {
                 animationState = AnimationState.GettingUp;
             }
             break;
         case AnimationState.GettingUp:
             GetUp();
             break;
         default:
             break;
     }
 }
开发者ID:LeSphax,项目名称:Only-two-options,代码行数:27,代码来源:Falling.cs


示例9: OnStateAnimationChange

    public void OnStateAnimationChange(AnimationState previousState, AnimationState actualState)
    {
        bool change = false;
        switch (actualState) {
            case AnimationState.WALK:
            case AnimationState.CHASE:
            case AnimationState.RUN_AWAY:
                if (settedFX) break;
                settedFX = true;
                change = true;
                break;

            default:
                if (!settedFX) break;
                settedFX = false;
                change = true;
                break;
        }

        if (change) {
            foreach (ParticleSystem system in walkingFX.GetComponentsInChildren<ParticleSystem>()) {
                ParticleSystem.EmissionModule emission = system.emission;
                emission.enabled = settedFX;
            }
        }
    }
开发者ID:MaturuturuStudios,项目名称:Drop,代码行数:26,代码来源:AntParticles.cs


示例10: Start

 // Use this for initialization
 void Start()
 {
     mOctopusAnim = GetComponent<Animator>();
     mOctopusAnim.SetFloat(mBlendTree, 1.0f);
     mRandomRange = Random.Range(minAttackTime, maxAttackTime);
     mAnimState = AnimationState.Idle;
 }
开发者ID:CenzyGames,项目名称:Save-your-date-new,代码行数:8,代码来源:OctopusScr.cs


示例11: Update

 // Update is called once per frame
 void Update()
 {
     if (Input.GetAxis("Horizontal")>0)
     {
         animationState=AnimationState.walkRight;
         currentIdleTime=0.0f;
         startIdleTime=true;
     }
     else if (Input.GetAxis("Horizontal")<0)
     {
         animationState=AnimationState.walkLeft;
         currentIdleTime=0.0f;
         startIdleTime=true;
     }
     else if (Input.GetAxis("Vertical")>0)
     {
         animationState=AnimationState.walkBack;
         currentIdleTime=0.0f;
         startIdleTime=true;
     }
     else if (Input.GetAxis("Vertical")<0)
     {
         animationState=AnimationState.walkFront;
         currentIdleTime=0.0f;
         startIdleTime=true;
     }
     if (startIdleTime)
     {
         UpdateToIdleAnimations();
     }
     UpdateAnimation();
 }
开发者ID:BigBearGCU,项目名称:MazeJ4C,代码行数:33,代码来源:AnimatedPlayer.cs


示例12: Initialise

 protected void Initialise()
 {
     // The Animation Controller feeds on AnimationStates. You've got to assign your animations to variables so that you can call them from the controller
     //
     GetComponent<Animation>()["Attack1"].speed = 2.0f;
     GetComponent<Animation>()["Attack2"].speed = 2.0f;
     //
     //
     animationAttack1Anticipation = GetComponent<Animation>()["Attack1Anticipation"];
     animationAttack1 = GetComponent<Animation>()["Attack1"];
     //
     animationAttack2Anticipation = GetComponent<Animation>()["Attack2Anticipation"];
     animationAttack2 = GetComponent<Animation>()["Attack2"];
     animationAttack3 = GetComponent<Animation>()["WhirlwindAttack"];
     //
     animationWhirlwind = GetComponent<Animation>()["Whirlwind"];
     animationIdle = GetComponent<Animation>()["Idle"];
     animationIdle.speed = 0.4f;
     animationRespawn = GetComponent<Animation>()["Resurection"];
     animationRespawn.speed = 0.8f;
     animationAttack3.speed = 0.8f;
     //
     leftSwipe.SetTime (0.0f, 0, 1);
     rightSwipe.SetTime (0.0f, 0, 1);
     //
 }
开发者ID:VirsixInc,项目名称:VRCubeSword,代码行数:26,代码来源:BladeMaster.cs


示例13: GetAnimationState

 public void GetAnimationState(Entity entity)
 {
     Entity = entity;
     State = Entity.GetAnimationState(StateName);
     State.Loop = Loop;
     State.Weight = 0;
 }
开发者ID:janPierdolnikParda,项目名称:RPG,代码行数:7,代码来源:Anim.cs


示例14: LoadAnimations

    private void LoadAnimations()
    {
        walkAnimationList = Resources.LoadAll<Sprite>("DwarfWalk").ToList();
        otherAnimationList = Resources.LoadAll<Sprite>("DwarfOther").ToList();

        spriteDirection = SpriteDirection.Down;
        animationState = AnimationState.IdleDown;
    }
开发者ID:tdonlan,项目名称:SpriteAnimationTest,代码行数:8,代码来源:PlayerController.cs


示例15: Animation

		public Animation (IAnimationDrawer drawer, uint duration, Easing easing, Blocking blocking)
		{
			this.Drawer = drawer;
			this.Duration = duration;
			this.Easing = easing;
			this.Blocking = blocking;
			this.AnimationState = AnimationState.Coming;
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:Animation.cs


示例16: Start

    void Start()
    {
        state = AnimationState.IDLE;

        status = Status.NOT_FOUND;

        //		RunTowards (new Vector3(transform.position.x +10f, transform.position.y, transform.position.z));
    }
开发者ID:TomAlanCarroll,项目名称:agent-search-and-rescue,代码行数:8,代码来源:SoldierController.cs


示例17: Attacking

 public void Attacking(Actor self, Target target)
 {
     State = AnimationState.Attacking;
     if (anim.HasSequence("shoot"))
         anim.PlayThen("shoot", () => State = AnimationState.Idle);
     else if (anim.HasSequence("heal"))
         anim.PlayThen("heal", () => State = AnimationState.Idle);
 }
开发者ID:patthoyts,项目名称:OpenRA,代码行数:8,代码来源:RenderInfantry.cs


示例18: Start

 // Use this for initialization
 void Start()
 {
     walk = animation["walking"];
     foreach (AnimationState state in animation)
     {
         state.speed = 4f;
     }
 }
开发者ID:BlueHexagon,项目名称:Vamp,代码行数:9,代码来源:AnimationTest.cs


示例19: Start

    void Start()
    {
        lifeValue = life.getBloodValue();
        life.addBloodValueChangeCallback(lifeChangedCall);

        fire1AnimationState = myAnimation["fire1"];
        fire2AnimationState = myAnimation["fire2"];
    }
开发者ID:Seraphli,项目名称:TheInsectersWar,代码行数:8,代码来源:ShieldPismireLifeChanged.cs


示例20: setAnimationState

 // set current animation and restart if it's a different animation
 public void setAnimationState(AnimationState animation)
 {
     if (currentAnimation != animation)
     {
         currentAnimation = animation;
         animationStateTime = 0;
     }
 }
开发者ID:jusjoo,项目名称:vauhtihyppely-2,代码行数:9,代码来源:SpriteAnimator.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AnimationType类代码示例发布时间:2022-05-24
下一篇:
C# Animation类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap