public void Play(GamerMotionType motionType, float motionSpeed = 1f) { if (!this.HasParameter(motionType.ToString())) { return; } this.gamerMotionType = motionType; this.MontionSpeed = motionSpeed; }
public float AnimationTime(GamerMotionType motionType) { AnimationClip animationClip; if (!this.animationClips.TryGetValue(motionType.ToString(), out animationClip)) { throw new Exception($"找不到该动作: {motionType}"); } return(animationClip.length); }
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; }