void OnEnable() { var mi = this.target as MuscleInspector; var animator = mi.GetComponent <Animator>(); if (animator != null && animator.avatar != null && animator.avatar.isValid && animator.avatar.isHuman ) { Debug.LogFormat("MuscleInspectorEditor.OnEnable"); m_handler = new HumanPoseHandler(animator.avatar, animator.transform); m_TreeView = new BoneTreeView(new TreeViewState(), GetHeaderState(), m_handler); } }
MultiColumnHeader GetHeaderState() { //bool firstInit = m_MultiColumnHeaderState == null; var headerState = BoneTreeView.CreateDefaultMultiColumnHeaderState(); /* * if (MultiColumnHeaderState.CanOverwriteSerializedFields(m_MultiColumnHeaderState, headerState)) * { * MultiColumnHeaderState.OverwriteSerializedFields(m_MultiColumnHeaderState, headerState); * } * m_MultiColumnHeaderState = headerState; */ var multiColumnHeader = new MultiColumnHeader(headerState); multiColumnHeader.ResizeToFit(); return(multiColumnHeader); }