void DrawLayoutsTool() { EditorGUILayout.LabelField("Put there parent of your Tooltip Layout", TPTooltipDesigner.skin.GetStyle("TipLabel")); EditorGUILayout.PropertyField(tooltipLayout, GUIContent.none, GUILayout.Height(30)); if (GUI.changed) { TPTooltipDesigner.UpdateManager(); if (TPTooltipDesigner.TooltipCreator.TooltipLayout) { TooltipLayout = new SerializedObject(TPTooltipDesigner.TooltipCreator.TooltipLayout); } tooltipLayout.serializedObject.ApplyModifiedProperties(); toggleItems = tooltipLayout.objectReferenceValue != null ? true : false; } EditorGUILayout.Space(); if (toggleItems) { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Show Texts")) { ToggleShow(0); } if (GUILayout.Button("Show Images")) { ToggleShow(1); } if (GUILayout.Button("Show Buttons")) { ToggleShow(2); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Text's Parent", TPTooltipDesigner.skin.GetStyle("TipLabel"), GUILayout.Width(140), GUILayout.Height(14)); EditorGUILayout.LabelField("Image's Parent", TPTooltipDesigner.skin.GetStyle("TipLabel"), GUILayout.Width(140), GUILayout.Height(14)); EditorGUILayout.LabelField("Button's Parent", TPTooltipDesigner.skin.GetStyle("TipLabel"), GUILayout.Width(140), GUILayout.Height(14)); EditorGUILayout.EndHorizontal(); if (layoutTextsParent == null || layoutImagesParent == null || layoutButtonsParent == null) { FindLayoutProperties(); return; } EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(layoutTextsParent, GUIContent.none, GUILayout.Height(20)); EditorGUILayout.PropertyField(layoutImagesParent, GUIContent.none, GUILayout.Height(20)); EditorGUILayout.PropertyField(layoutButtonsParent, GUIContent.none, GUILayout.Height(20)); if (GUI.changed) { TooltipLayout.ApplyModifiedProperties(); TPTooltipDesigner.UpdateManager(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); if (showBools[0]) { DrawItem(layoutTexts); } if (showBools[1]) { DrawItem(layoutImages); } if (showBools[2]) { DrawItem(layoutButtons); } } }
void AddObserver() { observerOBJList.arraySize++; observerOBJList.serializedObject.ApplyModifiedProperties(); TPTooltipDesigner.UpdateManager(); }