void SetupRecorders()
    {
        recordObjs          = gameObject.GetComponentsInChildren <Transform> ();
        objRecorders        = new UnityObjectAnimation[recordObjs.Length];
        blendShapeRecorders = new List <UnityBlendShapeAnimation> ();

        frameIndex = 0;
        nowTime    = 0.0f;

        for (int i = 0; i < recordObjs.Length; i++)
        {
            string path = AnimationRecorderHelper.GetTransformPathName(transform, recordObjs [i]);
            objRecorders [i] = new UnityObjectAnimation(path, recordObjs [i]);

            // check if theres blendShape
            if (recordBlendShape)
            {
                if (recordObjs [i].GetComponent <SkinnedMeshRenderer> ())
                {
                    SkinnedMeshRenderer tempSkinMeshRenderer = recordObjs [i].GetComponent <SkinnedMeshRenderer> ();

                    // there is blendShape exist
                    if (tempSkinMeshRenderer.sharedMesh.blendShapeCount > 0)
                    {
                        blendShapeRecorders.Add(new UnityBlendShapeAnimation(path, tempSkinMeshRenderer));
                    }
                }
            }
        }

        if (changeTimeScale)
        {
            Time.timeScale = timeScaleOnStart;
        }
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        recordObjs   = gameObject.GetComponentsInChildren <Transform> ();
        objRecorders = new UnityObjectAnimation[recordObjs.Length];

        for (int i = 0; i < recordObjs.Length; i++)
        {
            string path = AnimationRecorderHelper.GetTransformPathName(transform, recordObjs [i]);
            objRecorders [i] = new UnityObjectAnimation(path, recordObjs [i]);
        }

        if (changeTimeScale)
        {
            Time.timeScale = timeScaleOnStart;
        }
    }