示例#1
0
    void OnGUI()
    {
        DTPoolBossInspectorUtility.DrawUILine(DTPoolBossInspectorUtility.DividerColor);
        GUILayout.Label("Welcome to Pool Boss for Unity! The buttons below are shortcuts to commonly used help options.", EditorStyles.textArea);
        DTPoolBossInspectorUtility.DrawUILine(DTPoolBossInspectorUtility.DividerColor);

        GUILayout.Label("Help", EditorStyles.boldLabel);

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Manual", GUILayout.Width(90)))
        {
            Application.OpenURL("http://www.dtdevtools.com/downloads/poolboss/PB_ReadMe.pdf");
        }
        if (GUILayout.Button("Videos", GUILayout.Width(90)))
        {
            Application.OpenURL("https://www.youtube.com/watch?v=aBEkcHO6vZk&index=3&list=PLW6fMWQDKB24osBmTuJd0IG8R5tOim6eV");
        }
        if (GUILayout.Button("Scripting API", GUILayout.Width(90)))
        {
            Application.OpenURL("http://www.dtdevtools.com/API/poolboss/index.html");
        }
        if (GUILayout.Button("Support Forum", GUILayout.Width(100)))
        {
            Application.OpenURL("http://bit.ly/PioYZW");
        }
        EditorGUILayout.EndHorizontal();
        DTPoolBossInspectorUtility.DrawUILine(DTPoolBossInspectorUtility.DividerColor);

        GUILayout.Label("Optional package support", EditorStyles.boldLabel);
        GUILayout.Label("Enable support for:");

#if UNITY_2018_2_OR_NEWER
        // Addressables
        var enableAddress = DTPBDefineHelper.DoesScriptingDefineSymbolExist(AddresablesSymbol);
        var newAddress    = GUILayout.Toggle(enableAddress, " Addressables (" + AddresablesSymbol + ")");
        if (newAddress != enableAddress)
        {
            if (newAddress)
            {
                DTPBDefineHelper.TryAddScriptingDefineSymbols(AddresablesSymbol);
            }
            else
            {
                DTPBDefineHelper.TryRemoveScriptingDefineSymbols(AddresablesSymbol);
            }
        }
#endif

        DTPoolBossInspectorUtility.ShowLargeBarAlert("Enabling a package you do not have installed will cause a compile error and you will not be able to use this window to undo until you install the missing package.");

        DTPoolBossInspectorUtility.DrawUILine(DTPoolBossInspectorUtility.DividerColor);

        EditorGUILayout.BeginHorizontal();
        var show    = showOnStartPrefs;
        var newShow = GUILayout.Toggle(show, " Show at start");
        if (newShow != show)
        {
            showOnStartPrefs = newShow;
        }
        GUILayout.FlexibleSpace();
        if (GUILayout.Button(new GUIContent("Email Support", "*****@*****.**"), GUILayout.Width(100)))
        {
            Application.OpenURL("mailto:[email protected]");
        }

        EditorGUILayout.EndHorizontal();
    }