Пример #1
0
 public LBAnimationInfo(string _animationn_name, int _animation_layer)
 {
     AnimationName       = _animationn_name;
     AnimationLayer      = _animation_layer;
     AnimationTransition = LBAnimTransitionType.Switch;
     TransitionTime      = 0;
 }
Пример #2
0
 public LBAnimationInfo(string _animationn_name, int _animation_layer, LBAnimTransitionType _transition, float _transition_time)
 {
     AnimationName       = _animationn_name;
     AnimationLayer      = _animation_layer;
     AnimationTransition = _transition;
     TransitionTime      = _transition_time;
 }
Пример #3
0
        public LBAnimationInfo(SerializedProperty _anim)
        {
            SerializedProperty a;

            a = _anim;
            a.Next(true);
            AnimationName = a.stringValue;
            a.Next(false);
            AnimationLayer = a.intValue;
            a.Next(false);
            AnimationTransition = (LBAnimTransitionType)a.enumValueIndex;
            a.Next(false);
            TransitionTime = a.floatValue;
        }
Пример #4
0
        //protected override void Perform()
        //{

        //}

        protected void PlayAnimation(string anim, int layer = 0, float offset = 0, LBAnimTransitionType transition = LBAnimTransitionType.Switch, float blend = 0.1f)
        {
            startanimtime = animator.GetCurrentAnimatorStateInfo(animations[current_state].AnimationLayer).normalizedTime;

            if (anim == string.Empty)
            {
                return;
            }

            //animator.Play(anim, layer, offset);

            //curanimname = anim;
            //curanimlayer = layer;

            if (transition == LBAnimTransitionType.Switch)
            {
                animator.Play(anim, layer, offset);
            }
            else if (transition == LBAnimTransitionType.Corssfade)
            {
                animator.CrossFade(anim, blend, layer);
            }
        }