private void Reset()
 {
     boneRenderer = gameObject.GetComponent <BoneRenderer>();
     if (rootObject == null)
     {
         rootObject = gameObject.transform.Find("Root").gameObject;
     }
 }
示例#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();
        }
    }
示例#3
0
 public static void OnBoneRendererDisabled(BoneRenderer obj)
 {
     s_BoneRendererComponents.Remove(obj);
 }
示例#4
0
 public static void OnBoneRendererEnabled(BoneRenderer obj)
 {
     s_BoneRendererComponents.Add(obj);
 }