Ejemplo n.º 1
0
    protected virtual void OnGuiMainWizard()
    {
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.Label(WizardIcon);
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        EditorGUILayout.Separator();

        GUILayout.Label(CurrentLang.PUNWizardLabel, EditorStyles.boldLabel);
        if (isPunPlus)
        {
            GUILayout.Label(CurrentLang.MobilePunPlusExportNoteLabel);
        }
        else if (!InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.Android) || !InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.iOS))
        {
            GUILayout.Label(CurrentLang.MobileExportNoteLabel);
        }
        EditorGUILayout.Separator();


        // settings button
        GUILayout.BeginHorizontal();
        GUILayout.Label(CurrentLang.SettingsButton, EditorStyles.boldLabel, GUILayout.Width(100));
        if (GUILayout.Button(new GUIContent(CurrentLang.SetupButton, CurrentLang.SetupServerCloudLabel)))
        {
            this.InitPhotonSetupWindow();
        }

        GUILayout.EndHorizontal();
        EditorGUILayout.Separator();


        // find / select settings asset
        GUILayout.BeginHorizontal();
        GUILayout.Label(CurrentLang.SettingsFileLabel, EditorStyles.boldLabel, GUILayout.Width(100));
        if (GUILayout.Button(new GUIContent(CurrentLang.LocateSettingsButton, CurrentLang.SettingsHighlightLabel)))
        {
            EditorGUIUtility.PingObject(PhotonEditor.Current);
        }

        GUILayout.EndHorizontal();


        GUILayout.FlexibleSpace();

        // converter
        GUILayout.BeginHorizontal();
        GUILayout.Label(CurrentLang.ConverterLabel, EditorStyles.boldLabel, GUILayout.Width(100));
        if (GUILayout.Button(new GUIContent(CurrentLang.StartButton, CurrentLang.UNtoPUNLabel)))
        {
            PhotonConverter.RunConversion();
        }

        GUILayout.EndHorizontal();
        EditorGUILayout.Separator();


        // documentation
        GUILayout.BeginHorizontal();
        GUILayout.Label(CurrentLang.DocumentationLabel, EditorStyles.boldLabel, GUILayout.Width(100));
        GUILayout.BeginVertical();
        if (GUILayout.Button(new GUIContent(CurrentLang.OpenPDFText, CurrentLang.OpenPDFTooltip)))
        {
            EditorUtility.OpenWithDefaultApp(DocumentationLocation);
        }

        if (GUILayout.Button(new GUIContent(CurrentLang.OpenDevNetText, CurrentLang.OpenDevNetTooltip)))
        {
            EditorUtility.OpenWithDefaultApp(UrlDevNet);
        }

        if (GUILayout.Button(new GUIContent(CurrentLang.OpenCloudDashboardText, CurrentLang.OpenCloudDashboardTooltip)))
        {
            EditorUtility.OpenWithDefaultApp(UrlCloudDashboard + Uri.EscapeUriString(this.emailAddress));
        }

        if (GUILayout.Button(new GUIContent(CurrentLang.OpenForumText, CurrentLang.OpenForumTooltip)))
        {
            EditorUtility.OpenWithDefaultApp(UrlForum);
        }

        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
    }
Ejemplo n.º 2
0
    protected virtual void UiMainWizard()
    {
        GUILayout.Space(15);

        // title
        UiTitleBox(CurrentLang.PUNWizardLabel, BackgroundImage);

        // wizard info text
        GUILayout.Label(CurrentLang.WizardMainWindowInfo);
        GUILayout.Space(15);


        // pun+ info
        if (isPunPlus)
        {
            GUILayout.Label(CurrentLang.MobilePunPlusExportNoteLabel);
            GUILayout.Space(15);
        }
#if !(UNITY_5_0 || UNITY_5)
        else if (!InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.Android) || !InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.iPhone))
        {
            GUILayout.Label(CurrentLang.MobileExportNoteLabel);
            GUILayout.Space(15);
        }
#endif

        // settings button
        GUILayout.BeginHorizontal();
        GUILayout.Label(CurrentLang.SettingsButton, EditorStyles.boldLabel, GUILayout.Width(100));
        GUILayout.BeginVertical();
        if (GUILayout.Button(new GUIContent(CurrentLang.LocateSettingsButton, CurrentLang.SettingsHighlightLabel)))
        {
            HighlightSettings();
        }
        if (GUILayout.Button(new GUIContent(CurrentLang.OpenCloudDashboardText, CurrentLang.OpenCloudDashboardTooltip)))
        {
            Application.OpenURL(UrlCloudDashboard + Uri.EscapeUriString(this.mailOrAppId));
        }
        if (GUILayout.Button(new GUIContent(CurrentLang.SetupButton, CurrentLang.SetupServerCloudLabel)))
        {
            this.photonSetupState = PhotonSetupStates.RegisterForPhotonCloud;
        }
        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
        GUILayout.Space(15);


        // converter
        GUILayout.BeginHorizontal();
        GUILayout.Label(CurrentLang.ConverterLabel, EditorStyles.boldLabel, GUILayout.Width(100));
        if (GUILayout.Button(new GUIContent(CurrentLang.StartButton, CurrentLang.UNtoPUNLabel)))
        {
            PhotonConverter.RunConversion();
        }

        GUILayout.EndHorizontal();
        EditorGUILayout.Separator();


        // documentation
        GUILayout.BeginHorizontal();
        GUILayout.Label(CurrentLang.DocumentationLabel, EditorStyles.boldLabel, GUILayout.Width(100));
        GUILayout.BeginVertical();
        if (GUILayout.Button(new GUIContent(CurrentLang.OpenPDFText, CurrentLang.OpenPDFTooltip)))
        {
            EditorUtility.OpenWithDefaultApp(DocumentationLocation);
        }

        if (GUILayout.Button(new GUIContent(CurrentLang.OpenDevNetText, CurrentLang.OpenDevNetTooltip)))
        {
            Application.OpenURL(UrlDevNet);
        }

        GUI.skin.label.wordWrap = true;
        GUILayout.Label(CurrentLang.OwnHostCloudCompareLabel);
        if (GUILayout.Button(CurrentLang.ComparisonPageButton))
        {
            Application.OpenURL(UrlCompare);
        }


        if (GUILayout.Button(new GUIContent(CurrentLang.OpenForumText, CurrentLang.OpenForumTooltip)))
        {
            Application.OpenURL(UrlForum);
        }

        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
    }
    protected virtual void OnGuiMainWizard()
    {
        // settings button
        GUILayout.BeginHorizontal();
        GUILayout.Label("Settings", EditorStyles.boldLabel, GUILayout.Width(100));
        if (GUILayout.Button(new GUIContent("Setup", "Setup wizard for setting up your own server or the cloud.")))
        {
            this.InitPhotonSetupWindow();
        }

        GUILayout.EndHorizontal();
        GUILayout.Space(12);

        // converter
        GUILayout.BeginHorizontal();
        GUILayout.Label("Converter", EditorStyles.boldLabel, GUILayout.Width(100));
        if (GUILayout.Button(new GUIContent("Start", "Converts pure Unity Networking to Photon Unity Networking.")))
        {
            PhotonConverter.RunConversion();
        }

        GUILayout.EndHorizontal();
        GUILayout.Space(12);

        // add PhotonView
        GUILayout.BeginHorizontal();
        GUILayout.Label("Component", EditorStyles.boldLabel, GUILayout.Width(100));
        if (GUILayout.Button(new GUIContent("Add PhotonView", "Also in menu: Component, Miscellaneous")))
        {
            if (Selection.activeGameObject != null)
            {
                Selection.activeGameObject.AddComponent <PhotonView>();
            }
        }

        GUILayout.EndHorizontal();
        GUILayout.Space(22);

        // license
        GUILayout.BeginHorizontal();
        GUILayout.Label("Licenses", EditorStyles.boldLabel, GUILayout.Width(100));

        if (GUILayout.Button(new GUIContent("Download Free", "Get your free license for up to 100 concurrent players.")))
        {
            EditorUtility.OpenWithDefaultApp(UrlFreeLicense);
        }

        GUILayout.EndHorizontal();
        GUILayout.Space(12);

        // documentation
        GUILayout.BeginHorizontal();
        GUILayout.Label("Documentation", EditorStyles.boldLabel, GUILayout.Width(100));
        GUILayout.BeginVertical();
        if (GUILayout.Button(new GUIContent("Open PDF", "Opens the local documentation pdf.")))
        {
            EditorUtility.OpenWithDefaultApp(DocumentationLocation);
        }

        if (GUILayout.Button(new GUIContent("Open DevNet", "Online documentation for Photon.")))
        {
            EditorUtility.OpenWithDefaultApp(UrlDevNet);
        }

        if (GUILayout.Button(new GUIContent("Open Cloud Dashboard", "Review Cloud App information and statistics.")))
        {
            EditorUtility.OpenWithDefaultApp(UrlAccountPage + Uri.EscapeUriString(this.emailAddress));
        }

        if (GUILayout.Button(new GUIContent("Open Forum", "Online support for Photon.")))
        {
            EditorUtility.OpenWithDefaultApp(UrlForum);
        }

        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
    }
Ejemplo n.º 4
0
    void OnGUI()
    {
        scrollPos = GUILayout.BeginScrollView(scrollPos);

        if (guiState == GUIState.nullState)
        {
            ReloadHostingSettingsFromFile();
        }
        else
        if (guiState == GUIState.Main)
        {
            // converter
            GUILayout.BeginHorizontal();
            GUILayout.Label("Settings", EditorStyles.boldLabel, GUILayout.Width(100));
            if (GUILayout.Button(new GUIContent("Setup", "Setup wizard for setting up your own server or the cloud.")))
            {
                OpenSetup();
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(12);

            // converter
            GUILayout.BeginHorizontal();
            GUILayout.Label("Converter", EditorStyles.boldLabel, GUILayout.Width(100));
            if (GUILayout.Button(new GUIContent("Start", "Converts pure Unity Networking to Photon Unity Networking.")))
            {
                PhotonConverter.RunConversion();
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(12);


            // add PhotonView
            GUILayout.BeginHorizontal();
            GUILayout.Label("Component", EditorStyles.boldLabel, GUILayout.Width(100));
            if (GUILayout.Button(new GUIContent("Add PhotonView", "Also in menu: Component, Miscellaneous")))
            {
                if (Selection.activeGameObject != null)
                {
                    Selection.activeGameObject.AddComponent <PhotonView>();
                }
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(22);

            // license
            GUILayout.BeginHorizontal();
            GUILayout.Label("Licenses", EditorStyles.boldLabel, GUILayout.Width(100));

            if (GUILayout.Button(new GUIContent("Download Free", "Get your free license for up to 100 concurrent players.")))
            {
                EditorUtility.OpenWithDefaultApp(UrlFreeLicense);
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(12);

            // documentation
            GUILayout.BeginHorizontal();
            GUILayout.Label("Documentation", EditorStyles.boldLabel, GUILayout.Width(100));
            GUILayout.BeginVertical();
            if (GUILayout.Button(new GUIContent("Open PDF", "Opens the local documentation pdf.")))
            {
                EditorUtility.OpenWithDefaultApp(DocumentationLocation);
            }
            if (GUILayout.Button(new GUIContent("Open DevNet", "Online documentation for Photon.")))
            {
                EditorUtility.OpenWithDefaultApp(UrlDevNet);
            }
            if (GUILayout.Button(new GUIContent("Open Forum", "Online support for Photon.")))
            {
                EditorUtility.OpenWithDefaultApp(UrlForum);
            }
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
        }
        else
        {
            SetupGUI();
        }
        GUILayout.EndScrollView();
    }
Ejemplo n.º 5
0
    protected virtual void OnGuiMainWizard()
    {
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.Label(WizardIcon);
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        EditorGUILayout.Separator();

        GUILayout.Label("Photon Unity Networking (PUN) Wizard", EditorStyles.boldLabel);
        if (!InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.Android) || !InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.iPhone))
        {
            GUILayout.Label("Note: Export to mobile will require iOS Pro / Android Pro.");
        }
        EditorGUILayout.Separator();

        // settings button
        GUILayout.BeginHorizontal();
        GUILayout.Label("Settings", EditorStyles.boldLabel, GUILayout.Width(100));
        if (GUILayout.Button(new GUIContent("Setup", "Setup wizard for setting up your own server or the cloud.")))
        {
            this.InitPhotonSetupWindow();
        }

        GUILayout.EndHorizontal();
        EditorGUILayout.Separator();

        // converter
        GUILayout.BeginHorizontal();
        GUILayout.Label("Converter", EditorStyles.boldLabel, GUILayout.Width(100));
        if (GUILayout.Button(new GUIContent("Start", "Converts pure Unity Networking to Photon Unity Networking.")))
        {
            PhotonConverter.RunConversion();
        }

        GUILayout.EndHorizontal();
        EditorGUILayout.Separator();

        // find / select settings asset
        GUILayout.BeginHorizontal();
        GUILayout.Label("Settings File", EditorStyles.boldLabel, GUILayout.Width(100));
        if (GUILayout.Button(new GUIContent("Locate settings asset", "Highlights the used photon settings file in the project.")))
        {
            EditorGUIUtility.PingObject(PhotonEditor.Current);
        }

        GUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();

        // documentation
        GUILayout.BeginHorizontal();
        GUILayout.Label("Documentation", EditorStyles.boldLabel, GUILayout.Width(100));
        GUILayout.BeginVertical();
        if (GUILayout.Button(new GUIContent("Open PDF", "Opens the local documentation pdf.")))
        {
            EditorUtility.OpenWithDefaultApp(DocumentationLocation);
        }

        if (GUILayout.Button(new GUIContent("Open DevNet", "Online documentation for Photon.")))
        {
            EditorUtility.OpenWithDefaultApp(UrlDevNet);
        }

        if (GUILayout.Button(new GUIContent("Open Cloud Dashboard", "Review Cloud App information and statistics.")))
        {
            EditorUtility.OpenWithDefaultApp(UrlCloudDashboard + Uri.EscapeUriString(this.emailAddress));
        }

        if (GUILayout.Button(new GUIContent("Open Forum", "Online support for Photon.")))
        {
            EditorUtility.OpenWithDefaultApp(UrlForum);
        }

        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
    }