private void Reset()
 {
     boneRenderer = gameObject.GetComponent <BoneRenderer>();
     if (rootObject == null)
     {
         rootObject = gameObject.transform.Find("Root").gameObject;
     }
 }
Beispiel #2
0
    public void loadFromFile(string filename)
    {
        bvhParser = new BVHParser(File.ReadAllText(filename));

        SkeletonConverter converter = new SkeletonConverter();

        converter.createFromBVH(bvhParser);
        this.size = converter.size;
        root      = converter.rootObj.transform;
        foreach (Transform child in this.transform)
        {
            UnityEngine.Object.DestroyImmediate(child.gameObject);
        }
        root.parent = this.transform;

        UnityEngine.Animations.Rigging.BoneRenderer myBoneRenderer = this.GetComponent <UnityEngine.Animations.Rigging.BoneRenderer>();
        if (converter != null && converter.rootObj != null && myBoneRenderer != null)
        {
            myBoneRenderer.transforms = converter.transforms.ToArray();
        }
    }
Beispiel #3
0
 public static void OnBoneRendererDisabled(BoneRenderer obj)
 {
     s_BoneRendererComponents.Remove(obj);
 }
Beispiel #4
0
 public static void OnBoneRendererEnabled(BoneRenderer obj)
 {
     s_BoneRendererComponents.Add(obj);
 }