コード例 #1
0
    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!");
    }
コード例 #2
0
ファイル: LegController.cs プロジェクト: BibleUs/Personality
    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!");
    }