Пример #1
0
        void OnSelectionChanged()
        {
            var go = Selection.activeObject as GameObject;

            if (go is null)
            {
                return;
            }

            var meta = go.GetComponentInParent <VRMMeta>();

            if (meta == m_currentRoot)
            {
                return;
            }

            m_currentRoot = meta;
            if (m_currentRoot is null)
            {
                m_treeViewState = null;
                m_treeView      = null;
            }
            else
            {
                // update treeview
                Debug.Log(m_currentRoot);
                m_treeViewState = new TreeViewState();
                m_treeView      = new VRMSpringBoneTreeView(m_treeViewState, m_currentRoot);
            }

            Repaint();
        }
Пример #2
0
            public VRMMetaObject SetActiveGameObject(GameObject go)
            {
                var target = go?.GetComponent <VRMMeta>();

                if (m_target != target)
                {
                    m_target     = target;
                    m_metaEditor = null;
                }
                return(GetVRMMetaObject());
            }
Пример #3
0
 public VRMSpringBoneTreeView(TreeViewState treeViewState, VRMMeta root)
     : base(treeViewState)
 {
     m_root = root;
     Reload();
 }