Exemplo n.º 1
0
    void OnGUI()
    {
        if (window == null)
        {
            window = (VRCSdkControlPanel)EditorWindow.GetWindow(typeof(VRCSdkControlPanel));
            InitializeStyles();
        }

        if (_bannerImage == null)
        {
            _bannerImage = Resources.Load <Texture2D>("SDK_Panel_Banner");
        }

        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.BeginVertical();

        GUILayout.Box(_bannerImage);

        if (Application.isPlaying)
        {
            GUI.enabled = false;
            GUILayout.Space(20);
            EditorGUILayout.LabelField("Unity Application is running ...\nStop it to access the Control Panel", titleGuiStyle, GUILayout.Width(SdkWindowWidth));
            GUI.enabled = true;
            GUILayout.EndVertical();
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            return;
        }

        EditorGUILayout.Space();

        EnvConfig.SetActiveSDKDefines();

        int showPanel = GUILayout.Toolbar(VRCSettings.ActiveWindowPanel, _toolbarLabels, APIUser.IsLoggedIn ? _toolbarOptionsLoggedIn : _toolbarOptionsNotLoggedIn, null, GUILayout.Width(SdkWindowWidth));

        // Only show Account or Settings panels if not logged in
        if (APIUser.IsLoggedIn == false && showPanel != 3)
        {
            showPanel = 0;
        }

        if (showPanel != VRCSettings.ActiveWindowPanel)
        {
            VRCSettings.ActiveWindowPanel = showPanel;
        }

        GUILayout.EndVertical();
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        switch (showPanel)
        {
        case 1:
            ShowBuilders();
            break;

        case 2:
            ShowContent();
            break;

        case 3:
            ShowSettings();
            break;

        case 0:
        default:
            ShowAccount();
            break;
        }
    }
Exemplo n.º 2
0
    void OnGUI()
    {
        if (window == null)
        {
            window = (VRCSdkControlPanel)EditorWindow.GetWindow(typeof(VRCSdkControlPanel));
            InitializeStyles();
        }

        if (_bannerImage == null)
        {
            _bannerImage = AssetDatabase.LoadAssetAtPath("Assets/VRCSDK/Dependencies/VRChat/SdkGraphics/SDK_Panel_Banner.png", typeof(Texture2D)) as Texture2D;
        }

        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.BeginVertical();

        GUILayout.Box(_bannerImage);

        if (Application.isPlaying)
        {
            GUI.enabled = false;
            GUILayout.Space(20);
            EditorGUILayout.LabelField("Unity Application is running ...\nStop it to access the Control Panel", titleGuiStyle, GUILayout.Width(SdkWindowWidth));
            GUI.enabled = true;
            GUILayout.EndVertical();
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            return;
        }

        EditorGUILayout.Space();

        EnvConfig.SetActiveSDKDefines();

        VRCSettings.ActiveWindowPanel = GUILayout.Toolbar(VRCSettings.ActiveWindowPanel, new string[] { "Authentication", "Builder", "Content Manager", "Settings" }, GUILayout.Width(SdkWindowWidth));
        int showPanel = VRCSettings.ActiveWindowPanel;

        GUILayout.EndVertical();
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        if (APIUser.IsLoggedInWithCredentials == false && showPanel != 3)
        {
            showPanel = 0;
        }

        switch (showPanel)
        {
        case 1:
            ShowBuilders();
            break;

        case 2:
            ShowContent();
            break;

        case 3:
            ShowSettings();
            break;

        case 0:
        default:
            ShowAccount();
            break;
        }
    }
Exemplo n.º 3
0
    void OnGUI()
    {
        if (window == null)
        {
            window = (VRCSdkControlPanel)EditorWindow.GetWindow(typeof(VRCSdkControlPanel));
            InitializeStyles();
        }

        if (_bannerImage == null)
        {
            _bannerImage = AssetDatabase.LoadAssetAtPath("Assets/VRCSDK/Dependencies/VRChat/Resources/SDK Images/SDK_Panel_Banner.png", typeof(Texture2D)) as Texture2D;
        }


        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.BeginVertical();

        GUILayout.Box(_bannerImage);

        if (Application.isPlaying)
        {
            GUI.enabled = false;
            GUILayout.Space(20);
            EditorGUILayout.LabelField("Unity Application is running ...\nStop it to access the Control Panel", titleGuiStyle, GUILayout.Width(SdkWindowWidth));
            GUI.enabled = true;
            GUILayout.EndVertical();
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            return;
        }

        GUI.backgroundColor = new Color(
            UnityEditor.EditorPrefs.GetFloat("SDKColor_R"),
            UnityEditor.EditorPrefs.GetFloat("SDKColor_G"),
            UnityEditor.EditorPrefs.GetFloat("SDKColor_B"),
            UnityEditor.EditorPrefs.GetFloat("SDKColor_A")
            );


        EnvConfig.SetActiveSDKDefines();

#if VRC_SDK_VRCSDK2
        VRCSettings.Get().activeWindowPanel = GUILayout.Toolbar(VRCSettings.Get().activeWindowPanel, new string[] { "Login", "Builder", "Content", "Settings", "Assets", "Changelog" }, GUILayout.Width(SdkWindowWidth));
        int showPanel = VRCSettings.Get().activeWindowPanel;
#elif VRC_SDK_VRCSDK3
        VRC.SDK3.Editor.VRCSettings.Get().activeWindowPanel = GUILayout.Toolbar(VRC.SDK3.Editor.VRCSettings.Get().activeWindowPanel, new string[] { "Authentication", "Builder", "Content Manager", "Settings" }, GUILayout.Width(SdkWindowWidth));
        int showPanel = VRC.SDK3.Editor.VRCSettings.Get().activeWindowPanel;
#else
        int showPanel = 0;
        #endif

        GUILayout.EndVertical();
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        if (APIUser.IsLoggedInWithCredentials == false && showPanel != 3 && showPanel != 4 && showPanel != 5 && showPanel != 6)
        {
            showPanel = 0;
        }

        switch (showPanel)
        {
        case 1:
            ShowBuilder();
            break;

        case 2:
            ShowContent();
            break;

        case 3:
            ShowSettings();
            break;

        case 4:
            ShowImports();
            break;

        case 5:
            ShowChanges();
            break;

        case 0:
        default:
            ShowAccount();
            break;
        }
    }