UnityEditor.EditorGUILayout.InspectorTitlebar C# (CSharp) Method

InspectorTitlebar() public static method

Make an inspector-window-like titlebar.

public static InspectorTitlebar ( bool foldout, Object targetObj ) : bool
foldout bool The foldout state shown with the arrow.
targetObj Object The object (for example a component) or objects that the titlebar is for.
return bool
        public static bool InspectorTitlebar(bool foldout, Object targetObj)
        {
            return InspectorTitlebar(foldout, targetObj, true);
        }

Same methods

EditorGUILayout::InspectorTitlebar ( bool foldout, Object targetObj, bool expandable ) : bool
EditorGUILayout::InspectorTitlebar ( Object targetObjs ) : void

Usage Example

Beispiel #1
0
 public override void OnInspectorGUI()
 {
     if (Event.current.type == EventType.ValidateCommand && Event.current.commandName == "UndoRedoPerformed")
     {
         AvatarSetupTool.TransferPoseToDescription(base.serializedObject, base.root);
         for (int i = 0; i < this.m_Bones.Length; i++)
         {
             this.m_Bones[i].Serialize(base.serializedObject);
         }
     }
     this.UpdateSelectedBone();
     if (Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.Backspace || Event.current.keyCode == KeyCode.Delete) && AvatarMappingEditor.s_SelectedBoneIndex != -1 && AvatarMappingEditor.s_SelectedBoneIndex < this.m_Bones.Length)
     {
         Undo.RegisterCompleteObjectUndo(this, "Avatar mapping modified");
         AvatarSetupTool.BoneWrapper boneWrapper = this.m_Bones[AvatarMappingEditor.s_SelectedBoneIndex];
         boneWrapper.bone  = null;
         boneWrapper.state = BoneState.None;
         boneWrapper.Serialize(base.serializedObject);
         Selection.activeTransform = null;
         GUI.changed = true;
         Event.current.Use();
     }
     GUILayout.BeginVertical(new GUILayoutOption[0]);
     EditorGUI.BeginChangeCheck();
     GUILayout.BeginVertical(string.Empty, "TE NodeBackground", new GUILayoutOption[0]);
     this.m_BodyView = AvatarControl.ShowBoneMapping(this.m_BodyView, new AvatarControl.BodyPartFeedback(this.IsValidBodyPart), this.m_Bones, base.serializedObject, this);
     this.HandleBodyView(this.m_BodyView);
     GUILayout.EndVertical();
     this.m_FoldoutScroll = GUILayout.BeginScrollView(this.m_FoldoutScroll, AvatarMappingEditor.styles.box, new GUILayoutOption[]
     {
         GUILayout.MinHeight(80f),
         GUILayout.MaxHeight(500f),
         GUILayout.ExpandHeight(true)
     });
     this.DisplayFoldout();
     GUILayout.FlexibleSpace();
     GUILayout.EndScrollView();
     if (EditorGUI.EndChangeCheck())
     {
         this.ValidateMapping();
         SceneView.RepaintAll();
     }
     this.DisplayMappingButtons();
     GUILayout.EndVertical();
     if (GUIUtility.hotControl == 0)
     {
         this.TransferPoseIfChanged();
     }
     base.ApplyRevertGUI();
     if (Selection.activeTransform != null)
     {
         if (this.m_CurrentTransformEditor != null && this.m_CurrentTransformEditor.target != Selection.activeTransform)
         {
             UnityEngine.Object.DestroyImmediate(this.m_CurrentTransformEditor);
         }
         if (this.m_CurrentTransformEditor == null)
         {
             this.m_CurrentTransformEditor = Editor.CreateEditor(Selection.activeTransform);
         }
         EditorGUILayout.Space();
         this.m_CurrentTransformEditorFoldout = EditorGUILayout.InspectorTitlebar(this.m_CurrentTransformEditorFoldout, Selection.activeTransform, true);
         if (this.m_CurrentTransformEditorFoldout && this.m_CurrentTransformEditor != null)
         {
             this.m_CurrentTransformEditor.OnInspectorGUI();
         }
     }
     else if (this.m_CurrentTransformEditor != null)
     {
         UnityEngine.Object.DestroyImmediate(this.m_CurrentTransformEditor);
         this.m_CurrentTransformEditor = null;
     }
 }
All Usage Examples Of UnityEditor.EditorGUILayout::InspectorTitlebar