Пример #1
0
 public void Play(GamerMotionType motionType, float motionSpeed = 1f)
 {
     if (!this.HasParameter(motionType.ToString()))
     {
         return;
     }
     this.gamerMotionType = motionType;
     this.MontionSpeed    = motionSpeed;
 }
Пример #2
0
        public float AnimationTime(GamerMotionType motionType)
        {
            AnimationClip animationClip;

            if (!this.animationClips.TryGetValue(motionType.ToString(), out animationClip))
            {
                throw new Exception($"找不到该动作: {motionType}");
            }
            return(animationClip.length);
        }
Пример #3
0
        public void PlayInTime(GamerMotionType motionType, float time)
        {
            AnimationClip animationClip;

            if (!this.animationClips.TryGetValue(motionType.ToString(), out animationClip))
            {
                throw new Exception($"找不到该动作: {motionType}");
            }

            float motionSpeed = animationClip.length / time;

            if (motionSpeed < 0.01f || motionSpeed > 1000f)
            {
                Log.Error($"motionSpeed数值异常, {motionSpeed}, 此动作跳过");
                return;
            }
            this.gamerMotionType = motionType;
            this.MontionSpeed    = motionSpeed;
        }