private void OnGUI() { if (!enabled) { DrawDisabled(); return; } if (Application.isPlaying) { return; } HOTweenEditorGUI.GUIStart(this, src, undoManager, labelsWidth, fieldsWidth); GUILayout.Space(4); GUILayout.Label("HOTween v" + HOTween.VERSION + " | Editor v" + HOTweenEditor.VERSION, HOGUIStyle.miniLabel); winScroll = GUILayout.BeginScrollView(winScroll); GUILayout.Space(2); HOTweenEditorGUI.DrawPanel(); GUILayout.EndScrollView(); GUILayout.Space(20); // Needed to avoid bottom Unity bar to hide something (stack panels bug). HOTweenEditorGUI.GUIEnd(); }
// =================================================================================== // GUI METHODS ----------------------------------------------------------------------- private void DrawDisabled() { GUILayout.Space(20); switch (disabledReason) { case DisabledReason.NotInitialized: GUILayout.Space(20); GUILayout.Label("HOTween Editor\nv" + VERSION + "\n\nClick to initialize", HOGUIStyle.wordWrapCenteredLabelBold); break; case DisabledReason.NoManager: GUILayout.Label("HOTween Editor\nv" + VERSION + "\n\nIn order to use the editor, an HOTweenManager instance needs to be added in your scene", HOGUIStyle.wordWrapCenteredLabelBold); if (GUILayout.Button("Add HOTweenManager")) { InstantiateManager(); } break; case DisabledReason.TooManyManagers: GUILayout.Label("Beware!\nThere are " + twManagersGOs.Length + " HOTweenManagers in this scene.\nYou should delete all but one.\n", HOGUIStyle.wordWrapCenteredLabelBold); if (GUILayout.Button("Select All HOTweenManagers")) { Selection.objects = twManagersGOs; EditorWindow h = HOTweenEditorGUI.GetHierarchyPanel(); if (h != null) { h.Focus(); // Focus Hierarchy panel. } } break; } }
override public void OnInspectorGUI() { HOTweenEditorGUI.GUIStart(this, src, undoManager, LabelsWidth, FieldsWidth); GUILayout.Space(4); GUILayout.Label("HOTween v" + HOTween.VERSION + " | Editor v" + HOTweenEditor.VERSION, HOGUIStyle.miniLabel); GUILayout.Space(2); HOTweenEditorGUI.DrawPanel(); HOTweenEditorGUI.GUIEnd(); }