public static void OpenWindow()
 {
     if (EditorApplication.isPlaying)
     {
         Debug.Log("You can't change Tooltip Designer runtime!");
         return;
     }
     window       = (TPTooltipDesigner)GetWindow(typeof(TPTooltipDesigner));
     currentScene = EditorSceneManager.GetActiveScene().name;
     EditorApplication.hierarchyWindowChanged += hierarchyWindowChanged;
     window.minSize = new Vector2(615, 290);
     window.maxSize = new Vector2(615, 290);
     window.Show();
 }
        public void OpenCreator()
        {
            if (TPTooltipCreator.DebugMode)
            {
                if (serializedObject.targetObject.hideFlags != HideFlags.NotEditable)
                {
                    serializedObject.targetObject.hideFlags = HideFlags.NotEditable;
                }
                return;
            }

            if (serializedObject.targetObject.hideFlags != HideFlags.None)
            {
                serializedObject.targetObject.hideFlags = HideFlags.None;
            }

            if (GUILayout.Button("Open Tooltip Manager", GUILayout.Height(30)))
            {
                TPTooltipDesigner.OpenWindow();
            }
        }
        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();
 }