public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Layer");
        _mSPLayer.intValue = EditorGUILayout.IntField(_mSPLayer.intValue);
        EditorGUILayout.EndHorizontal();

        DoozyUIHelper.VerticalSpace(4);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Test Sorting Order");
        _mSPTestSortingOrder.intValue = EditorGUILayout.IntField(_mSPTestSortingOrder.intValue);
        EditorGUILayout.EndHorizontal();

        DoozyUIHelper.VerticalSpace(4);

        if (GUILayout.Button("Update Test Sorting Order", GUILayout.Height(EditorGUIUtility.singleLineHeight * 3)))
        {
            _mTarget.UpdateSortingOrder(_mSPTestSortingOrder.intValue);
        }

        serializedObject.ApplyModifiedProperties();
        EditorUtility.SetDirty(target);
    }
    void ShowTriggerEvent()
    {
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightGreen);
        EditorGUILayout.PropertyField(sp_onTriggerEvent, GUILayout.Width(410));
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);

        DoozyUIHelper.VerticalSpace(4);

        #region Send GameEvents
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
        DoozyUIHelper.VerticalSpace(8);
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarSendGameEvents);

        if (uiTrigger.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Type in the game events that you want this trigger to send", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        if (GUILayout.Button("add game event", GUILayout.Width(224)))
        {
            if (uiTrigger.gameEvents == null)
            {
                uiTrigger.gameEvents = new List <string>();
            }

            uiTrigger.gameEvents.Add(string.Empty);
        }

        if (uiTrigger.gameEvents != null)                        //we check if the gameEvents list has any items in it
        {
            for (int i = 0; i < uiTrigger.gameEvents.Count; i++) //we show the list of elements
            {
                DoozyUIHelper.VerticalSpace(2);
                EditorGUILayout.BeginHorizontal();
                uiTrigger.gameEvents[i] = EditorGUILayout.TextField(uiTrigger.gameEvents[i], GUILayout.Width(200));
                if (GUILayout.Button("x", GUILayout.Height(12)))
                {
                    uiTrigger.gameEvents.RemoveAt(i);
                }
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
            }
        }
        DoozyUIHelper.ResetColors();
        #endregion
    }
    public override void OnInspectorGUI()
    {
        //base.OnInspectorGUI();

        UpdateSerializedProperties();

        uiManager = target as UIManager;

        serializedObject.Update();

        DoozyUIHelper.VerticalSpace(8);

        #region Header
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarUiManager);
        #endregion

        DoozyUIHelper.VerticalSpace(8);

        if (EditorApplication.isCompiling)
        {
            EditorGUILayout.BeginHorizontal();
            DoozyUIHelper.DrawTexture(DoozyUIResources.MessageWaitCompile);
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();

            DoozyUIHelper.VerticalSpace(158);

            Repaint();
            return;
        }

        EditorGUILayout.BeginHorizontal();

        #region Show Help
        DoozyUIHelper.ResetColors();
        uiManager.showHelp = EditorGUILayout.ToggleLeft("Show Help", uiManager.showHelp, GUILayout.Width(80));
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        #endregion

        #region Debug Events
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
        uiManager._debugEvents = EditorGUILayout.ToggleLeft("Debug Events", uiManager._debugEvents, GUILayout.Width(90));
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        #endregion

        #region Debug Buttons
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
        uiManager._debugButtons = EditorGUILayout.ToggleLeft("Debug Buttons", uiManager._debugButtons, GUILayout.Width(100));
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        #endregion

        #region Debug Notifications
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
        uiManager._debugNotifications = EditorGUILayout.ToggleLeft("Debug Notifications", uiManager._debugNotifications, GUILayout.Width(130));
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        #endregion

        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        DoozyUIHelper.VerticalSpace(8);

        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);

        #region MasterAudio Settings
#if dUI_MasterAudio
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarMaEnabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonDisable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Disable support for MasterAudio?", "This will remove 'dUI_MasterAudio' from Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                RemoveScriptingDefineSymbol("dUI_MasterAudio");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If disabled, it removes 'dUI_MasterAudio' from PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        sp_useMasterAudio_PlaySoundAndForget.boolValue = EditorGUILayout.ToggleLeft("Use PlaySoundAndForget method", sp_useMasterAudio_PlaySoundAndForget.boolValue);
        sp_useMasterAudio_FireCustomEvent.boolValue    = EditorGUILayout.ToggleLeft("Use FireCustomEvent method", sp_useMasterAudio_FireCustomEvent.boolValue);
        if (sp_useMasterAudio_PlaySoundAndForget.boolValue && sp_useMasterAudio_FireCustomEvent.boolValue)
        {
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightRed);
            EditorGUILayout.HelpBox("Use either PlaySoundAndForget or FireCustomEvent, but do not enable both of them at once.", MessageType.Error);
        }
#else
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarMaDisabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonEnable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Enable support for MasterAudio?", "Enable this only if you have MasterAudio already installed. This will add 'dUI_MasterAudio' to Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                AddScriptingDefineSymbol("dUI_MasterAudio");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If enabled, it adds 'dUI_MasterAudio' to PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
#endif
        #endregion

        DoozyUIHelper.VerticalSpace(8);

        #region TextMeshPro Settings
#if dUI_TextMeshPro
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarTmpEnabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonDisable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Disable support for TextMeshPro?", "This will remove 'dUI_TextMeshPro' from Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                RemoveScriptingDefineSymbol("dUI_TextMeshPro");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If disabled, it removes 'dUI_TextMeshPro' from PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
        }
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        sp_useTextMeshPro.boolValue = EditorGUILayout.ToggleLeft("Use TextMeshPro in UINotifications", sp_useTextMeshPro.boolValue);
#else
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarTmpDisabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonEnable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Enable support for TextMeshPro?", "Enable this only if you have TextMeshPro already installed. This will add 'dUI_TextMeshPro' to Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                AddScriptingDefineSymbol("dUI_TextMeshPro");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If enabled, it adds 'dUI_TextMeshPro' to PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
#endif
        #endregion

        DoozyUIHelper.VerticalSpace(8);

        #region EnergyBarToolkit Settings
#if dUI_EnergyBarToolkit
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarEbtEnabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonDisable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Disable support for EnergyBarToolkit?", "This will remove 'dUI_EnergyBarToolkit' from Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                RemoveScriptingDefineSymbol("dUI_EnergyBarToolkit");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If disabled, it removes 'dUI_EnergyBarToolkit' from PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
#else
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarEbtDisabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonEnable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Enable support for EnergyBarToolkit?", "Enable this only if you have EnergyBarToolkit already installed. This will add 'dUI_EnergyBarToolkit' to Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                AddScriptingDefineSymbol("dUI_EnergyBarToolkit");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If enabled, it adds 'dUI_EnergyBarToolkit' to PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
#endif
        #endregion

        DoozyUIHelper.VerticalSpace(8);

        #region Playmaker Settings
#if dUI_PlayMaker
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarPmEnabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonDisable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Disable support for PlayMaker?", "This will remove 'dUI_PlayMaker' from Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                RemoveScriptingDefineSymbol("dUI_PlayMaker");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If disabled, it removes 'dUI_PlayMaker' from PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
#else
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarPmDisabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonEnable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Enable support for PlayMaker?", "Enable this only if you have PlayMaker already installed. This will add 'dUI_PlayMaker' to Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                AddScriptingDefineSymbol("dUI_PlayMaker");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If enabled, it adds 'dUI_PlayMaker' to PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
#endif
        #endregion

        DoozyUIHelper.VerticalSpace(8);

        #region Orientation Manager Settings
#if dUI_UseOrientationManager
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarOmEnabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonDisable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Disable the Orientation Manager?", "The LANDSCAPE and PORTRAIT options from UIElement components will no longer be available. This will remove 'dUI_UseOrientationManager' from Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                RemoveScriptingDefineSymbol("dUI_UseOrientationManager");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If enabled, it removes 'dUI_NavigationDisabled' from PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
#else
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarOmDisabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonEnable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Enable the Orientation Manager?", "Enable this only if you want to create different UI's for each orientation. This will add 'dUI_UseOrientationManager' to Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                AddScriptingDefineSymbol("dUI_UseOrientationManager");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
#endif
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If enabled, it adds 'dUI_UseOrientationManager' to PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
        }
        #endregion

        DoozyUIHelper.VerticalSpace(8);

        #region Navigation System Settings
#if dUI_NavigationDisabled
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarNavDisabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonEnable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Enable the Navigation Manager?", "This will add 'dUI_NavigationDisabled' to Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                RemoveScriptingDefineSymbol("dUI_NavigationDisabled");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If enabled, it removes 'dUI_NavigationDisabled' from PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
#else
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarNavEnabled);
        GUILayout.Space(318);
        if (GUILayout.Button(DoozyUIResources.BarButtonDisable, GUIStyle.none, GUILayout.Width(64), GUILayout.Height(32)))
        {
            if (EditorUtility.DisplayDialog("Disable the Navigation Manager?", "Do this if you intend to handle the navigation yourself (maybe use Playmaker to do it?). This will add 'dUI_NavigationDisabled' to Scripting Define Symbols in Player Settings.", "Ok", "Cancel"))
            {
                AddScriptingDefineSymbol("dUI_NavigationDisabled");
            }
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
#endif
        if (uiManager.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("If disabled, it adds 'dUI_NavigationDisabled' to PlayerSettings --> Scripting Define Symbols. It takes a few seconds to update.", MessageType.None);
            EditorGUILayout.HelpBox("Enable it if you want to handle the navigation yourself (the back button and navigation options). This is useful if you are using a FSM system like PlayMaker in order to have a visual control over the UI. This switch will also modify the UIButton component and disable several other options. (See the documentation for more details)", MessageType.None);
        }
        #endregion

        DoozyUIHelper.VerticalSpace(8);

        DoozyUIHelper.ResetColors();
        serializedObject.ApplyModifiedProperties();
        EditorUtility.SetDirty(target);
    }
    public override void OnInspectorGUI()
    {
        //base.DrawDefaultInspector();

        if (sceneLoader == null)
        {
            sceneLoader = (DoozyUI.SceneLoader)target;
        }

        UpdateSerializedProperties();

        serializedObject.Update();

        DoozyUIHelper.VerticalSpace(8);

        #region Header
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarSceneLoader);
        #endregion

        #region InfoBox
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);

        EditorGUILayout.HelpBox("Here you can customize the game event commands that trigger different methods for scene loading.", MessageType.Info);

#if (UNITY_5_1 || UNITY_5_2)
        EditorGUILayout.HelpBox("Your Unity version is [" + unityVersion + "] and for scene loading Application.LoadLevel methods will be used.", MessageType.None);
#endif

#if (UNITY_5_1 == false && UNITY_5_2 == false)
        EditorGUILayout.HelpBox("Your Unity version is [" + unityVersion + "] and for scene loading SceneManager.LoadSceneAsync methods will be used.", MessageType.None);
#endif
        #endregion

        DoozyUIHelper.VerticalSpace(8);

        #region ShowHelp
        DoozyUIHelper.ResetColors();
        sceneLoader.showHelp = EditorGUILayout.ToggleLeft("Show Help", sceneLoader.showHelp, GUILayout.Width(160));
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        #endregion

        DoozyUIHelper.VerticalSpace(8);

        #region EnergyBars
#if dUI_EnergyBarToolkit
        EditorGUILayout.BeginHorizontal();
        DoozyUIHelper.DrawTexture(DoozyUIResources.LogoEBT);
        GUILayout.Space(4);
        EditorGUILayout.BeginVertical();
        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Add bar", GUILayout.Width(366)))
        {
            GetEnergyBars.Add(new EnergyBar());
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (GetEnergyBars.Count > 0)
        {
            for (int i = 0; i < GetEnergyBars.Count; i++)
            {
                DoozyUIHelper.VerticalSpace(2);
                EditorGUILayout.BeginHorizontal();
                GetEnergyBars[i] = EditorGUILayout.ObjectField(GetEnergyBars[i], typeof(EnergyBar), true, GUILayout.Width(340)) as EnergyBar;
                if (GUILayout.Button("x", GUILayout.Width(20), GUILayout.Height(12)))
                {
                    GetEnergyBars.RemoveAt(i);
                }
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
            }

            sceneLoader.energyBars = GetEnergyBars;
        }
        else
        {
            DoozyUIHelper.VerticalSpace(20);
        }
        EditorGUILayout.EndVertical();

        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("You should link the EnergyBars you want to update on when you load a scene. They will show the load progress of that scene.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);
#endif
        #endregion

        DoozyUIHelper.VerticalSpace(8);

        #region Interface for Unity 5.1 and Unity 5.2
#if (UNITY_5_1 || UNITY_5_2)
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("LoadLevel Async by Name", GUILayout.Width(210));
        sp_command_LoadSceneAsync_SceneName.stringValue = EditorGUILayout.TextField(sp_command_LoadSceneAsync_SceneName.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo load the scene named 'MySceneName_5' you need to send a game event with the command 'LoadSceneAsync_Name_MySceneName_5', where 'LoadSceneAsync_Name_' is the command and 'MySceneName_5' is the name of the scene you want to load.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("LoadLevel Async by ID", GUILayout.Width(210));
        sp_command_LoadSceneAsync_SceneBuildIndex.stringValue = EditorGUILayout.TextField(sp_command_LoadSceneAsync_SceneBuildIndex.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo load the 5th scene in your build index you need to send a game event with the command 'LoadSceneAsync_ID_5', where 'LoadSceneAsync_ID_' is the command and '5' is the name of the index number of the scene you want to load.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("LoadLevel Additive Async by Name", GUILayout.Width(210));
        sp_command_LoadSceneAdditiveAsync_SceneName.stringValue = EditorGUILayout.TextField(sp_command_LoadSceneAdditiveAsync_SceneName.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo load the scene named 'MySceneName_5' you need to send a game event with the command 'LoadSceneAdditiveAsync_Name_MySceneName_5', where 'LoadSceneAdditiveAsync_Name_' is the command and 'MySceneName_5' is the name of the scene you want to load.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("LoadLevel Additive Async by ID", GUILayout.Width(210));
        sp_command_LoadSceneAdditiveAsync_SceneBuildIndex.stringValue = EditorGUILayout.TextField(sp_command_LoadSceneAdditiveAsync_SceneBuildIndex.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo load the 5th scene in your build index you need to send a game event with the command 'LoadSceneAdditiveAsync_ID_5', where 'LoadSceneAdditiveAsync_ID_' is the command and '5' is the build index number of the scene you want to load.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("LoadLevel shortcut command", GUILayout.Width(210));
        sp_command_LoadLevel.stringValue = EditorGUILayout.TextField(sp_command_LoadLevel.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo load level 5 you need to send a game event with the command 'LoadLevel_5', where 'LoadLevel_' is the shortcut command and '5' is the level you want to load.", MessageType.None);
            EditorGUILayout.HelpBox("This will load the level by using the LoadLevelAdditiveAsync method.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Level Scene Name", GUILayout.Width(210));
        sp_levelSceneName.stringValue = EditorGUILayout.TextField(sp_levelSceneName.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("This is the name of your level scenes in build. Example: 'Level_1', 'Level_2' ... 'Level_100'", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
#endif
        #endregion

        #region Interface for Unity 5.3 and up
#if (UNITY_5_1 == false && UNITY_5_2 == false)
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("LoadScene Async by Name", GUILayout.Width(210));
        sp_command_LoadSceneAsync_SceneName.stringValue = EditorGUILayout.TextField(sp_command_LoadSceneAsync_SceneName.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo load the scene named 'MySceneName_5' you need to send a game event with the command 'LoadSceneAsync_Name_MySceneName_5', where 'LoadSceneAsync_Name_' is the first part of the command and 'MySceneName_5' is the name of the scene you want to load.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("LoadScene Async by ID", GUILayout.Width(210));
        sp_command_LoadSceneAsync_SceneBuildIndex.stringValue = EditorGUILayout.TextField(sp_command_LoadSceneAsync_SceneBuildIndex.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo load the 5th scene in your build index you need to send a game event with the command LoadSceneAsync_ID_5', where 'LoadSceneAsync_ID_' is the first part of the command and '5' is the build index number of the scene you want to load.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("LoadScene Additive Async by Name", GUILayout.Width(210));
        sp_command_LoadSceneAdditiveAsync_SceneName.stringValue = EditorGUILayout.TextField(sp_command_LoadSceneAdditiveAsync_SceneName.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo load the scene named 'MySceneName_5' you need to send a game event with the command 'LoadSceneAdditiveAsync_Name_MySceneName_5', where 'LoadSceneAdditiveAsync_Name_' is the first part of the comman and 'MySceneName_5' is the name of the scene you want to load.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("LoadScene Additive Async by ID", GUILayout.Width(210));
        sp_command_LoadSceneAdditiveAsync_SceneBuildIndex.stringValue = EditorGUILayout.TextField(sp_command_LoadSceneAdditiveAsync_SceneBuildIndex.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo load the 5th scene in your build index you need to send a game event with the command 'LoadSceneAdditiveAsync_ID_5', where 'LoadSceneAdditiveAsync_ID_' is the first part of the command and '5' is the build index number of the scene you want to load.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("UnloadScene by Name", GUILayout.Width(210));
        sp_command_UnloadScene_SceneName.stringValue = EditorGUILayout.TextField(sp_command_UnloadScene_SceneName.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo unload a scene named 'MySceneName_5' you need to send a game event with the command 'UnloadScene_Name_MyScene_5', where 'UnloadScene_Name_' is the first part of the command and 'MySceneName_5' is the name of the scene you want to unload.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("UnloadScene by ID", GUILayout.Width(210));
        sp_command_UnloadScene_SceneBuildIndex.stringValue = EditorGUILayout.TextField(sp_command_UnloadScene_SceneBuildIndex.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo unload the 5th scene in your build index you need to send a game event with the command 'UnloadScene_ID_5', where 'UnloadScene_ID_' is the first part of the command and '5' is the build index number of the scene you want to unload.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("LoadLevel shortcut command", GUILayout.Width(210));
        sp_command_LoadLevel.stringValue = EditorGUILayout.TextField(sp_command_LoadLevel.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo load level 5 you need to send a game event with the command 'LoadLevel_5', where 'LoadLevel_' is the shortcut command and '5' is the level you want to load.", MessageType.None);
            EditorGUILayout.HelpBox("This will load the level by using the SceneManager.LoadSceneAsync method with LoadSceneMode.Additive option.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("UnloadLevel shortcut command", GUILayout.Width(210));
        sp_command_UnloadLevel.stringValue = EditorGUILayout.TextField(sp_command_UnloadLevel.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Usage example: \nTo unload level 5 you need to send a game event with the command 'UnloadLevel_5', where 'UnloadLevel_' is the shortcut command and '5' is the level you want to unload.", MessageType.None);
            EditorGUILayout.HelpBox("This will unload the level by using the SceneManager.UnloadScene method.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Level Scene Name", GUILayout.Width(210));
        sp_levelSceneName.stringValue = EditorGUILayout.TextField(sp_levelSceneName.stringValue, GUILayout.Width(200));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (sceneLoader.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("This is the name for your level scenes in build. Example: 'Level_1', 'Level_2' ... 'Level_100'", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
#endif
        #endregion

        DoozyUIHelper.ResetColors();
        serializedObject.ApplyModifiedProperties();
        EditorUtility.SetDirty(target);
    }
Beispiel #5
0
    public override void OnInspectorGUI()
    {
        //base.DrawDefaultInspector();

        if (uiEffect == null)
        {
            uiEffect = (UIEffect)target;
        }

        UpdateSerializedProperties();

        serializedObject.Update();

        DoozyUIHelper.VerticalSpace(8);

        DoozyUIHelper.DrawTexture(DoozyUIResources.BarUiEffect);

        if (uiEffect.targetUIElement != null)
        {
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarEnabled);
        }
        else
        {
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarDisabled);
            if (uiEffect.showHelp)
            {
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightRed);
                EditorGUILayout.HelpBox("Link a target UIElement...", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }
        }

        DoozyUIHelper.VerticalSpace(4);

        #region Show Help
        DoozyUIHelper.ResetColors();
        uiEffect.showHelp = EditorGUILayout.ToggleLeft("Show Help", uiEffect.showHelp, GUILayout.Width(160));
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        #endregion

        DoozyUIHelper.VerticalSpace(4);

        EditorGUILayout.BeginHorizontal();

        EditorGUILayout.BeginVertical();

        if (uiEffect.targetUIElement == null)
        {
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightRed);
        }
        else
        {
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightGreen);
        }

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Target UIElement", GUILayout.Width(110));
        EditorGUILayout.PropertyField(sp_targetUIElement, GUIContent.none, GUILayout.Width(260));
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        DoozyUIHelper.ResetColors();


        if (uiEffect.targetUIElement == null && uiEffect.showHelp)
        {
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("Target UIElement: this effect will be linked to the show and hide events of the target element.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        if (uiEffect.targetUIElement == null)
        {
            EditorGUILayout.EndVertical();

            EditorGUILayout.EndHorizontal();
        }
        else
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("start delay", GUILayout.Width(65));
            sp_startDelay.floatValue = EditorGUILayout.FloatField(sp_startDelay.floatValue, GUILayout.Width(40));
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();

            if (uiEffect.showHelp)
            {
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("Target UIElement: this effect will be linked to the show and hide events of the target element.", MessageType.None);
                EditorGUILayout.HelpBox("start delay: after the show event, for the target element, has been issued, you can set a start delay before the effect plays.", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }

            GUILayout.Space(8);

            sp_playOnAwake.boolValue   = EditorGUILayout.ToggleLeft("play on awake", sp_playOnAwake.boolValue, GUILayout.Width(160));
            sp_stopInstantly.boolValue = EditorGUILayout.ToggleLeft("stop instantly on hide", sp_stopInstantly.boolValue, GUILayout.Width(160));

            EditorGUILayout.EndVertical();

            EditorGUILayout.EndHorizontal();

            if (uiEffect.showHelp)
            {
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("play on awake: just like the UIElement's 'start hidden' option, the play on awake should be used if this effect will be visible when the scene strts. Otherwise you should let this option unchecked.", MessageType.None);
                EditorGUILayout.HelpBox("stop instantly on hide: when the hide event, for the target element, has been issued, you can stop and clear the effect instantly (it will dissapear) or you can let it fade out (for the lifetime duration of the particles).", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }

            GUILayout.Space(8);

            EditorGUILayout.BeginHorizontal();

            EditorGUILayout.LabelField("effect position", GUILayout.Width(90));
            effectPosition = uiEffect.effectPosition;
            effectPosition = (UIEffect.EffectPosition)EditorGUILayout.EnumPopup(effectPosition, GUILayout.Width(125));
            sp_effectPosition.enumValueIndex = (int)effectPosition;
            DoozyUIHelper.VerticalSpace(8);
            EditorGUILayout.LabelField("sorting order step", GUILayout.Width(105));
            sp_sortingOrderStep.intValue = EditorGUILayout.IntField(sp_sortingOrderStep.intValue, GUILayout.Width(40));
            GUILayout.FlexibleSpace();

            EditorGUILayout.EndHorizontal();

            if (uiEffect.showHelp)
            {
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("effect position: this option adjusts the sorting order 'moving' the effect in front or behind the target UIElement's canvas sorting order.", MessageType.None);
                EditorGUILayout.HelpBox("sorting order step: this option goes hand in hand with the previous one, by selecting how many steps/levels should the effect sorting order be ajusted with. Example: if the target UIElement's canvas sorting order is 100 and we have a sorting order step of 5 then the effect can be either at 95 (if behind) or 105 (if in front).", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }

            DoozyUIHelper.VerticalSpace(16);

            if (GUILayout.Button("Update UIEffect SortingOrder"))
            {
                uiEffect.UpdateEffectSortingOrder();
            }

            if (uiEffect.showHelp)
            {
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("Update UI Effect: this option helps you adjust/update the sorting order on the fly whenever you want.", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }
        }

        DoozyUIHelper.ResetColors();
        serializedObject.ApplyModifiedProperties();
        EditorUtility.SetDirty(target);
    }
    public override void OnInspectorGUI()
    {
        if (uiNotification == null)
        {
            uiNotification = (UINotification)target;
        }

        //base.OnInspectorGUI();

        serializedObject.Update();

        LinkChildUIElementsToNotification();

        DoozyUIHelper.VerticalSpace(8);
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        #region Header
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarUiNotification);
        #endregion
        if (uiNotification.notificationContainer != null) //we check if this notification has at least a notification container attached (if not, we disable it)
        {
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarEnabled);
        }
        else
        {
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarDisabled);
        }
        DoozyUIHelper.VerticalSpace(8);
        #region Show Help
        DoozyUIHelper.ResetColors();
        uiNotification.showHelp = EditorGUILayout.ToggleLeft("Show Help", uiNotification.showHelp, GUILayout.Width(160));
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        #endregion
        DoozyUIHelper.VerticalSpace(8);
        #region Notification Container
        if (uiNotification.notificationContainer != null)
        {
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightGreen);
        }
        else
        {
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightRed);
        }
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.PropertyField(sp_notificationContainer, true, GUILayout.Width(410));
        EditorGUILayout.EndHorizontal();
        DoozyUIHelper.ResetColors();

        if (uiNotification.showHelp)
        {
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightRed);
            EditorGUILayout.HelpBox("required", MessageType.None);
            DoozyUIHelper.ResetColors();
            EditorGUILayout.HelpBox("This is a chld gameObject of the notification, with an UIElement component attached, that will serve as the main container of all the other notification elements. It should contain everything besides the overlay.", MessageType.None);
            EditorGUILayout.HelpBox("To play sounds when it appears and when it dissapears you can add them in the attached UIElement IN and OUT animations.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }
        #endregion
        DoozyUIHelper.VerticalSpace(8);
        if (uiNotification.notificationContainer != null)
        {
            #region Overlay
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(sp_overlay, true, GUILayout.Width(410));
            EditorGUILayout.EndHorizontal();

            if (uiNotification.showHelp)
            {
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
                EditorGUILayout.HelpBox("optional", MessageType.None);
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("This is the fullscreen overlay / color tint.", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }
            #endregion
        }
        DoozyUIHelper.VerticalSpace(8);
        if (uiNotification.notificationContainer != null)
        {
            #region Title
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(sp_title, true, GUILayout.Width(410));
            EditorGUILayout.EndHorizontal();

            if (uiNotification.showHelp)
            {
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
                EditorGUILayout.HelpBox("optional", MessageType.None);
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("This gameobject should have either a Text or a TextMeshProUGUI component attached.", MessageType.None);
                EditorGUILayout.HelpBox("If you used a TextMeshProUGUI componenet make sure TextMeshPro it is enabled in the UIManager or the Control Panel.", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }
            #endregion
        }
        DoozyUIHelper.VerticalSpace(8);
        if (uiNotification.notificationContainer != null)
        {
            #region Message
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(sp_message, true, GUILayout.Width(410));
            EditorGUILayout.EndHorizontal();

            if (uiNotification.showHelp)
            {
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
                EditorGUILayout.HelpBox("optional", MessageType.None);
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("This gameobject should have either a Text or a TextMeshProUGUI component attached.", MessageType.None);
                EditorGUILayout.HelpBox("If you used a TextMeshProUGUI componenet make sure TextMeshPro it is enabled in the UIManager or the Control Panel.", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }
            #endregion
        }
        DoozyUIHelper.VerticalSpace(8);
        if (uiNotification.notificationContainer != null)
        {
            #region Icon
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(sp_icon, true, GUILayout.Width(410));
            EditorGUILayout.EndHorizontal();

            if (uiNotification.showHelp)
            {
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
                EditorGUILayout.HelpBox("optional", MessageType.None);
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("Every notification can have a customized icon or you can leave it null. Link the Image component here and pass in the icon Sprite when you call the ShowNotification method.", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }
            #endregion
        }
        DoozyUIHelper.VerticalSpace(8);
        if (uiNotification.notificationContainer != null)
        {
            #region CloseButton
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(sp_closeButton, true, GUILayout.Width(410));
            EditorGUILayout.EndHorizontal();

            if (uiNotification.showHelp)
            {
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
                EditorGUILayout.HelpBox("optional", MessageType.None);
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("This is a special button as it coveres the entire notification area. This allows the user to dismiss at once the notification, just by touching/clicking on it.", MessageType.None);
                EditorGUILayout.HelpBox("TIP: you can attach a Button component to the Overlay. link it here and have a full screen close button", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }
            #endregion
        }
        DoozyUIHelper.VerticalSpace(8);
        if (uiNotification.notificationContainer != null)
        {
            #region Buttons
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(sp_buttons, true, GUILayout.Width(410));
            EditorGUILayout.EndHorizontal();

            if (uiNotification.showHelp)
            {
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
                EditorGUILayout.HelpBox("optional", MessageType.None);
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("These are the buttons you would like to be available for this notification. They can be turned on or off when you call the ShowNotification method.", MessageType.None);
                EditorGUILayout.HelpBox("See documentation for more details.", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }
            #endregion
        }
        DoozyUIHelper.VerticalSpace(8);
        if (uiNotification.notificationContainer != null)
        {
            #region Special Elements
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(sp_specialElements, true, GUILayout.Width(410));
            EditorGUILayout.EndHorizontal();

            if (uiNotification.showHelp)
            {
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
                EditorGUILayout.HelpBox("optional", MessageType.None);
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("If you added stars or anything else with an UIElement attached, you need to link it here", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }
            #endregion
        }
        DoozyUIHelper.VerticalSpace(8);
        if (uiNotification.notificationContainer != null)
        {
            #region Effects
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PropertyField(sp_effects, true, GUILayout.Width(410));
            EditorGUILayout.EndHorizontal();

            if (uiNotification.showHelp)
            {
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
                EditorGUILayout.HelpBox("optional", MessageType.None);
                DoozyUIHelper.ResetColors();
                EditorGUILayout.HelpBox("If you added any effects with UIEffect attached, you need to link them here so that they can work as intended", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }
            #endregion
        }
        DoozyUIHelper.ResetColors();
        serializedObject.ApplyModifiedProperties();
        EditorUtility.SetDirty(target);
    }
Beispiel #7
0
    public override void OnInspectorGUI()
    {
        if (playmakerEventDispacher == null)
        {
            playmakerEventDispacher = (PlaymakerEventDispatcher)target;
        }

        //base.OnInspectorGUI();

        serializedObject.Update();

        DoozyUIHelper.VerticalSpace(8);
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);

        #region Header
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarPmEventDispatcher);
        #endregion

        if (sp_dispatchGameEvents.boolValue == false && sp_dispatchButtonClicks.boolValue == false)
        {
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarDisabled);
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarSelectListener);
            if (playmakerEventDispacher.showHelp)
            {
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
                EditorGUILayout.HelpBox("Select at least one listener in order to activate the event dispatcher.", MessageType.None);
                DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
            }
        }
        else if (playmakerEventDispacher.targetFSM == null)
        {
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarDisabled);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightRed);
            EditorGUILayout.HelpBox("Please reference a Target FSM", MessageType.Error);
        }
        else
        {
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarEnabled);

            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightGreen);

            if (sp_dispatchGameEvents.boolValue && sp_dispatchButtonClicks.boolValue)
            {
                EditorGUILayout.HelpBox("Dispatching Game Events and Button Clicks...", MessageType.None);
            }
            else if (sp_dispatchGameEvents.boolValue)
            {
                EditorGUILayout.HelpBox("Dispatching Game Events...", MessageType.None);
            }
            else if (sp_dispatchButtonClicks.boolValue)
            {
                EditorGUILayout.HelpBox("Dispatching Button Clicks...", MessageType.None);
            }

            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();

        #region Show Help
        DoozyUIHelper.ResetColors();
        playmakerEventDispacher.showHelp = EditorGUILayout.ToggleLeft("Show Help", playmakerEventDispacher.showHelp, GUILayout.Width(100));
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        #endregion

        #region Debug This
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);
        playmakerEventDispacher.debugThis = EditorGUILayout.ToggleLeft("Debug This", playmakerEventDispacher.debugThis, GUILayout.Width(100));
        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        #endregion

        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        DoozyUIHelper.VerticalSpace(8);

        EditorGUILayout.BeginHorizontal();

        #region Override Target FSM
        sp_overrideTargetFSM.boolValue = EditorGUILayout.ToggleLeft("Override Target FSM", sp_overrideTargetFSM.boolValue, GUILayout.Width(140));
        #endregion

        if (sp_overrideTargetFSM.boolValue == false)
        {
            playmakerEventDispacher.targetFSM = playmakerEventDispacher.gameObject.GetComponent <PlayMakerFSM>();
        }
        else
        {
            EditorGUILayout.PropertyField(sp_targetFSM, GUIContent.none, GUILayout.Width(270));
        }

        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();

        if (playmakerEventDispacher.targetFSM != null)
        {
            EditorGUILayout.HelpBox("Target FSM Name: " + playmakerEventDispacher.targetFSM.FsmName, MessageType.None);
        }

        DoozyUIHelper.VerticalSpace(8);

        #region Dispatch Game Events
        sp_dispatchGameEvents.boolValue = EditorGUILayout.ToggleLeft("Listen for Game Events", sp_dispatchGameEvents.boolValue);
        #endregion

        DoozyUIHelper.VerticalSpace(8);

        #region Dispatch Button Clicks
        sp_dispatchButtonClicks.boolValue = EditorGUILayout.ToggleLeft("Listen for Button Clicks", sp_dispatchButtonClicks.boolValue);
        #endregion

        if (playmakerEventDispacher.showHelp)
        {
            DoozyUIHelper.VerticalSpace(8);
            DoozyUIHelper.ResetColors();
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarGeneralInfo);
            DoozyUIHelper.VerticalSpace(1);
            EditorGUILayout.HelpBox("This dispatcher auto targets the first FSM on this GameObject. You can override that and reference the FSM you want to target.", MessageType.None);
            EditorGUILayout.HelpBox("For this dispatcher to work in Playmaker you have to create FSM events named exactly as the Game Event commands or buttonNames that you want to listen for and react to, in the FSM. The event names are case sensitive.", MessageType.None);
            EditorGUILayout.HelpBox("To dispatch Game Events, you have to create, in the FSM, events named exactly as the Game Event commands you wants to catch.", MessageType.None);
            EditorGUILayout.HelpBox("To dispatch Button Clicks, you have to create, in the FSM, events named exactly as the buttonNames you wants to catch.", MessageType.None);
            EditorGUILayout.HelpBox("Debug This will print to Debug.Log all the dispatched game events and/or button clicks.", MessageType.None);
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
        }

        DoozyUIHelper.VerticalSpace(8);

        DoozyUIHelper.ResetColors();
        serializedObject.ApplyModifiedProperties();
        EditorUtility.SetDirty(target);
    }
    public override void OnInspectorGUI()
    {
        if (uiTrigger == null)
        {
            uiTrigger = (UITrigger)target;
        }

        //base.OnInspectorGUI();

        serializedObject.Update();

        DoozyUIHelper.VerticalSpace(8);

        #region Header
        DoozyUIHelper.DrawTexture(DoozyUIResources.BarUiTrigger);
        #endregion

        if (isTriggerEnabled)
        {
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarEnabled);
        }
        else
        {
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarDisabled);
        }

        if (sp_triggerOnGameEvent.boolValue == false && sp_triggerOnButtonClick.boolValue == false)
        {
            DoozyUIHelper.DrawTexture(DoozyUIResources.BarSelectListener);

            ShowHelpInstructions();

            DoozyUIHelper.VerticalSpace(8);

            ShowHelpCheckbox();

            DoozyUIHelper.VerticalSpace(8);

            sp_gameEvent.stringValue  = string.Empty;
            sp_buttonName.stringValue = string.Empty;
            isTriggerEnabled          = false;
            buttonNameCurrentIndex    = 0;
            sp_dispatchAll.boolValue  = false;

            #region Listen Game Events
            sp_triggerOnGameEvent.boolValue = EditorGUILayout.ToggleLeft("Listen for Game Events", sp_triggerOnGameEvent.boolValue);
            #endregion

            DoozyUIHelper.VerticalSpace(4);

            #region Listen Button Clicks
            sp_triggerOnButtonClick.boolValue = EditorGUILayout.ToggleLeft("Listen for Button Clicks", sp_triggerOnButtonClick.boolValue);
            #endregion
        }
        else
        {
            if (sp_triggerOnGameEvent.boolValue)
            {
                if (string.IsNullOrEmpty(sp_gameEvent.stringValue) && sp_dispatchAll.boolValue == false)
                {
                    DoozyUIHelper.DrawTexture(DoozyUIResources.BarEnterGameEvent);
                    isTriggerEnabled = false;
                }
                else
                {
                    isTriggerEnabled = true;
                }

                ShowHelpInstructions();

                DoozyUIHelper.VerticalSpace(8);

                ShowHelpCheckbox();

                DoozyUIHelper.VerticalSpace(8);

                EditorGUILayout.BeginHorizontal();
                #region Listen Game Events
                sp_triggerOnGameEvent.boolValue = EditorGUILayout.ToggleLeft("Listen for Game Events", sp_triggerOnGameEvent.boolValue, GUILayout.Width(180));
                #endregion
                GUILayout.Space(8);
                #region DipatchAll
                sp_dispatchAll.boolValue = EditorGUILayout.ToggleLeft("Dispatch All Game Events", sp_dispatchAll.boolValue, GUILayout.Width(180));
                #endregion
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();

                if (sp_dispatchAll.boolValue == false)
                {
                    #region Game Event
                    DoozyUIHelper.VerticalSpace(4);

                    if (string.IsNullOrEmpty(sp_gameEvent.stringValue))
                    {
                        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightRed);
                    }
                    else
                    {
                        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightGreen);
                    }

                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Game Event", GUILayout.Width(80));
                    sp_gameEvent.stringValue = EditorGUILayout.TextField(sp_gameEvent.stringValue, GUILayout.Width(320));
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.EndHorizontal();

                    DoozyUIHelper.ResetColors();
                    #endregion
                }
            }
            else if (sp_triggerOnButtonClick.boolValue)
            {
                UpdateButtonNamesPopup();

                if (string.IsNullOrEmpty(sp_buttonName.stringValue) ||
                    sp_buttonName.stringValue.Equals(UIManager.DEFAULT_BUTTON_NAME) &&
                    sp_dispatchAll.boolValue == false)
                {
                    DoozyUIHelper.DrawTexture(DoozyUIResources.BarEnterButtonName);
                    isTriggerEnabled = false;
                }
                else
                {
                    isTriggerEnabled = true;
                }

                ShowHelpInstructions();

                DoozyUIHelper.VerticalSpace(8);

                ShowHelpCheckbox();

                DoozyUIHelper.VerticalSpace(8);

                EditorGUILayout.BeginHorizontal();
                #region Listen Button Clicks
                sp_triggerOnButtonClick.boolValue = EditorGUILayout.ToggleLeft("Listen for Button Clicks", sp_triggerOnButtonClick.boolValue, GUILayout.Width(180));
                #endregion
                GUILayout.Space(8);
                #region DipatchAll
                sp_dispatchAll.boolValue = EditorGUILayout.ToggleLeft("Dispatch All Button Clicks", sp_dispatchAll.boolValue, GUILayout.Width(180));
                #endregion
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();

                if (sp_dispatchAll.boolValue == false)
                {
                    #region Button Name

                    if (UIManager.GetIndexForButtonName(sp_buttonName.stringValue) == -1) //we have a button name that is not in the database; we reset this value
                    {
                        sp_buttonName.stringValue = UIManager.DEFAULT_BUTTON_NAME;
                    }

                    if (sp_buttonName.stringValue.Equals(UIManager.DEFAULT_BUTTON_NAME))
                    {
                        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightRed);
                    }
                    else
                    {
                        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightGreen);
                    }

                    DoozyUIHelper.VerticalSpace(4);
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Button Name", GUILayout.Width(80));
                    buttonNameCurrentIndex = UIManager.GetIndexForButtonName(sp_buttonName.stringValue);
                    buttonNameCurrentIndex = EditorGUILayout.Popup(buttonNameCurrentIndex, buttonNames, GUILayout.Width(320));
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.EndHorizontal();
                    sp_buttonName.stringValue = buttonNames[buttonNameCurrentIndex];

                    DoozyUIHelper.ResetColors();
                    #endregion
                }
            }

            DoozyUIHelper.VerticalSpace(8);

            if (isTriggerEnabled)
            {
                ShowTriggerEvent();
            }
        }

        DoozyUIHelper.ResetColors();
        serializedObject.ApplyModifiedProperties();
        EditorUtility.SetDirty(target);
    }
    void ShowHelpInstructions()
    {
        if (isTriggerEnabled)
        {
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightGreen);

            if (sp_triggerOnGameEvent.boolValue)
            {
                if (sp_dispatchAll.boolValue)
                {
                    EditorGUILayout.HelpBox("Dispatching ALL Game Events...", MessageType.None);

                    if (uiTrigger.showHelp)
                    {
                        DoozyUIHelper.ResetColors();
                        EditorGUILayout.HelpBox("Because you selected the Dispatch ALL option, you should be aware that in order for it to work as intended you must call a function that has a string as a paramater and...", MessageType.Info);
                        EditorGUILayout.HelpBox("It is VERY IMPORTANT that you select, in the 'On Trigger Event (String)' section, from the right drop down list, a function that is located in the 'Dynamic string' section (on top) and not the 'Static parameters' section (on bottom). See the documentation for mode details.", MessageType.Warning);
                    }
                }
                else
                {
                    EditorGUILayout.HelpBox("Dispatching the [" + sp_gameEvent.stringValue + "] Game Event...", MessageType.None);
                }
            }
            else if (sp_triggerOnButtonClick.boolValue)
            {
                if (sp_dispatchAll.boolValue)
                {
                    EditorGUILayout.HelpBox("Dispatching ALL Button Clicks...", MessageType.None);

                    if (uiTrigger.showHelp)
                    {
                        DoozyUIHelper.ResetColors();
                        EditorGUILayout.HelpBox("Because you selected the Dispatch ALL option, you should be aware that in order for it to work as intended you must call a function that has a string as a paramater and...", MessageType.Info);
                        EditorGUILayout.HelpBox("It is VERY IMPORTANT that you select, in the 'On Trigger Event (String)' section, from the right drop down list, a function that is located in the 'Dynamic string' section (on top) and not the 'Static parameters' section (on bottom). See the documentation for mode details.", MessageType.Warning);
                    }
                }
                else
                {
                    EditorGUILayout.HelpBox("Dispatching Button Clicks for the [" + sp_buttonName.stringValue + "] button...", MessageType.None);
                }
            }
        }
        else if (uiTrigger.showHelp)
        {
            DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.LightOranage);

            if (sp_triggerOnGameEvent.boolValue)
            {
                EditorGUILayout.HelpBox("Enter the game event you want this trigger to listen for. Or select Dispatch ALL to send all game events.", MessageType.None);
            }
            else if (sp_triggerOnButtonClick.boolValue)
            {
                EditorGUILayout.HelpBox("Select the button name you want this trigger to listen for. Or select Dispatch ALL to send all button clicks.", MessageType.None);
            }
            else
            {
                EditorGUILayout.HelpBox("You can activate this trigger by listening for either a game event or a button name.", MessageType.None);
            }
        }

        DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
    }
 void ShowHelpCheckbox()
 {
     DoozyUIHelper.ResetColors();
     uiTrigger.showHelp = EditorGUILayout.ToggleLeft("Show Help", uiTrigger.showHelp, GUILayout.Width(160));
     DoozyUIHelper.SetZoneColor(DoozyUIHelper.DoozyColor.Doozy);
 }