protected virtual void OnDisable() { skeletonMapper.OnDrop -= SkeletonMapper_onDrop; skeletonMapper.OnSelected -= SkeletonMapper_onSelected; skeletonMapper = null; skeletonJointListUI.OnDrop -= SkeletonMapper_onDrop; skeletonJointListUI.OnSelected -= SkeletonMapper_onSelected; skeletonJointListUI = null; ViewMode = skeletonBonesView.CurrentViewMode; skeletonBonesView.OnBoneSelected -= SkeletonBonesView_OnBoneSelected; skeletonBonesView.OnRemoveBone -= SkeletonBonesView_OnRemoveBone; skeletonBonesView = null; }
protected virtual void OnEnable() { NuitrackAvatar avatar = target as NuitrackAvatar; List <JointType> jointMask = jointFieldMap.Keys.ToList(); skeletonMapper = new SkeletonMapperGUI <Transform>(jointMask, optionalJoints); skeletonMapper.OnDrop += SkeletonMapper_onDrop; skeletonMapper.OnSelected += SkeletonMapper_onSelected; skeletonJointListUI = new SkeletonMapperListGUI <Transform>(jointMask, optionalJoints); skeletonJointListUI.OnDrop += SkeletonMapper_onDrop; skeletonJointListUI.OnSelected += SkeletonMapper_onSelected; skeletonBonesView = new SkeletonBonesView(avatar.transform, ViewMode); skeletonBonesView.OnBoneSelected += SkeletonBonesView_OnBoneSelected; skeletonBonesView.OnRemoveBone += SkeletonBonesView_OnRemoveBone; }