public void Init2() { // Analyze motions List <MotionAnalyzerBackwards> sourceAnimationBackwardsList = new List <MotionAnalyzerBackwards>(); for (int i = 0; i < sourceAnimations.Length; i++) { // Initialize motion objects Debug.Log("Analysing sourceAnimations[" + i + "]: " + sourceAnimations[i].name); sourceAnimations[i].Analyze(gameObject); // Also initialize backwards motion, if specified if (sourceAnimations[i].alsoUseBackwards) { MotionAnalyzerBackwards backwards = new MotionAnalyzerBackwards(); backwards.orig = sourceAnimations[i]; backwards.Analyze(gameObject); sourceAnimationBackwardsList.Add(backwards); } } sourceAnimationsBackwards = sourceAnimationBackwardsList.ToArray(); // Motion sampling have put bones in random pose... // Reset to grounded pose, time 0 gameObject.SampleAnimation(groundedPose, 0); initialized = true; Debug.Log("Initializing " + name + " Locomotion System... Done!"); }
public void Init2() { // Analyze motions List<MotionAnalyzerBackwards> sourceAnimationBackwardsList = new List<MotionAnalyzerBackwards>(); for (int i=0; i<sourceAnimations.Length; i++) { // Initialize motion objects Debug.Log("Analysing sourceAnimations["+i+"]: "+sourceAnimations[i].name); sourceAnimations[i].Analyze(gameObject); // Also initialize backwards motion, if specified if (sourceAnimations[i].alsoUseBackwards) { MotionAnalyzerBackwards backwards = new MotionAnalyzerBackwards(); backwards.orig = sourceAnimations[i]; backwards.Analyze(gameObject); sourceAnimationBackwardsList.Add(backwards); } } sourceAnimationsBackwards = sourceAnimationBackwardsList.ToArray(); // Motion sampling have put bones in random pose... // Reset to grounded pose, time 0 gameObject.SampleAnimation(groundedPose,0); initialized = true; Debug.Log("Initializing " + name + " Locomotion System... Done!"); }