本文整理汇总了C#中PhotonSetupStates类的典型用法代码示例。如果您正苦于以下问题:C# PhotonSetupStates类的具体用法?C# PhotonSetupStates怎么用?C# PhotonSetupStates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PhotonSetupStates类属于命名空间,在下文中一共展示了PhotonSetupStates类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RegisterWithEmail
protected virtual void RegisterWithEmail(string email)
{
EditorUtility.DisplayProgressBar(CurrentLang.ConnectionTitle, CurrentLang.ConnectionInfo, 0.5f);
string accountServiceType = string.Empty;
#if PHOTON_VOICE
accountServiceType = "voice";
#endif
AccountService client = new AccountService();
client.RegisterByEmail(email, RegisterOrigin, accountServiceType); // this is the synchronous variant using the static RegisterOrigin. "result" is in the client
EditorUtility.ClearProgressBar();
if (client.ReturnCode == 0)
{
this.mailOrAppId = client.AppId;
PhotonNetwork.PhotonServerSettings.UseCloud(this.mailOrAppId, 0);
#if PHOTON_VOICE
PhotonNetwork.PhotonServerSettings.VoiceAppID = client.AppId2;
#endif
PhotonEditor.SaveSettings();
this.photonSetupState = PhotonSetupStates.GoEditPhotonServerSettings;
}
else
{
PhotonNetwork.PhotonServerSettings.HostType = ServerSettings.HostingOption.PhotonCloud;
PhotonEditor.SaveSettings();
Debug.LogWarning(client.Message + " ReturnCode: " + client.ReturnCode);
if (client.Message.Contains("registered"))
{
this.photonSetupState = PhotonSetupStates.EmailAlreadyRegistered;
}
else
{
EditorUtility.DisplayDialog(CurrentLang.ErrorTextTitle, client.Message, CurrentLang.OkButton);
this.photonSetupState = PhotonSetupStates.RegisterForPhotonCloud;
}
}
}
开发者ID:2ty,项目名称:race3d,代码行数:41,代码来源:PhotonEditor.cs
示例2: UiMainWizard
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();
}
开发者ID:2ty,项目名称:race3d,代码行数:85,代码来源:PhotonEditor.cs
示例3: OnGuiSetupSelfhosting
protected virtual void OnGuiSetupSelfhosting()
{
GUILayout.Label(CurrentLang.YourPhotonServerLabel);
this.photonAddress = EditorGUILayout.TextField(CurrentLang.AddressIPLabel, this.photonAddress);
this.photonPort = EditorGUILayout.IntField(CurrentLang.PortLabel, this.photonPort);
this.photonProtocol = (ConnectionProtocol)EditorGUILayout.EnumPopup("Protocol", this.photonProtocol);
EditorGUILayout.Separator();
GUILayout.BeginHorizontal();
if (GUILayout.Button(CurrentLang.CancelButton))
{
GUIUtility.keyboardControl = 0;
this.ReApplySettingsToWindow();
}
if (GUILayout.Button(CurrentLang.SaveButton))
{
GUIUtility.keyboardControl = 0;
PhotonEditor.Current.UseMyServer(this.photonAddress, this.photonPort, null);
PhotonEditor.Current.Protocol = this.photonProtocol;
PhotonEditor.Save();
Inspect();
EditorUtility.DisplayDialog(CurrentLang.SettingsSavedTitle, CurrentLang.SettingsSavedMessage, CurrentLang.OkButton);
}
GUILayout.EndHorizontal();
GUILayout.Space(20);
// license
GUILayout.BeginHorizontal();
GUILayout.Label(CurrentLang.LicensesLabel, EditorStyles.boldLabel, GUILayout.Width(100));
if (GUILayout.Button(new GUIContent(CurrentLang.LicenseDownloadText, CurrentLang.LicenseDownloadTooltip)))
{
EditorUtility.OpenWithDefaultApp(UrlFreeLicense);
}
GUILayout.EndHorizontal();
GUILayout.Space(20);
GUILayout.Label(CurrentLang.TryPhotonAppLabel);
if (GUILayout.Button(CurrentLang.GetCloudAppButton))
{
this.cloudAppId = string.Empty;
this.photonSetupState = PhotonSetupStates.RegisterForPhotonCloud;
}
EditorGUILayout.Separator();
GUILayout.Label(CurrentLang.OwnHostCloudCompareLabel);
if (GUILayout.Button(CurrentLang.ComparisonPageButton))
{
Application.OpenURL(UrlCompare);
}
}
开发者ID:AsifAhmed16,项目名称:Operation-Hatirjheel,代码行数:64,代码来源:PhotonEditor.cs
示例4: OnGuiRegisterCloudApp
protected virtual void OnGuiRegisterCloudApp()
{
GUI.skin.label.wordWrap = true;
if (!this.isSetupWizard)
{
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button(CurrentLang.MainMenuButton, GUILayout.ExpandWidth(false)))
{
this.SwitchMenuState(GUIState.Main);
}
GUILayout.EndHorizontal();
}
GUILayout.Space(15);
GUI.skin.label.fontStyle = FontStyle.Bold;
GUILayout.Label(CurrentLang.SetupWizardTitle);
EditorGUILayout.Separator();
GUI.skin.label.fontStyle = FontStyle.Normal;
GUI.skin.label.richText = true;
GUILayout.Label(CurrentLang.SetupWizardInfo);
EditorGUILayout.Separator();
GUILayout.Label(CurrentLang.EmailOrAppIdLabel);
this.mailOrAppId = EditorGUILayout.TextField(this.mailOrAppId).Trim(); // note: we trim all input
if (mailOrAppId.Contains("@"))
{
// this should be a mail address
this.minimumInput = (mailOrAppId.Length >= 5 && mailOrAppId.Contains("."));
this.useMail = minimumInput;
this.useAppId = false;
}
else
{
// this should be an appId
this.minimumInput = ServerSettingsInspector.IsAppId(mailOrAppId);
this.useMail = false;
this.useAppId = minimumInput;
}
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button(CurrentLang.SkipButton, GUILayout.Width(100)))
{
this.photonSetupState = PhotonSetupStates.GoEditPhotonServerSettings;
this.useSkip = true;
this.useMail = false;
this.useAppId = false;
}
// SETUP button
EditorGUI.BeginDisabledGroup(!minimumInput);
if (GUILayout.Button(CurrentLang.SetupButton, GUILayout.Width(100)))
{
this.useSkip = false;
GUIUtility.keyboardControl = 0;
if (useMail)
{
this.RegisterWithEmail(this.mailOrAppId); // sets state
}
if (useAppId)
{
this.photonSetupState = PhotonSetupStates.GoEditPhotonServerSettings;
PhotonNetwork.PhotonServerSettings.UseCloud(this.mailOrAppId);
PhotonEditor.Save();
}
}
EditorGUI.EndDisabledGroup();
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
// existing account needs to fetch AppId online
if (this.photonSetupState == PhotonSetupStates.EmailAlreadyRegistered)
{
// button to open dashboard and get the AppId
GUILayout.Space(15);
GUILayout.Label("The email is registered so we can't fetch your AppId (without password).\n\nPlease login online to get your AppId.");
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button(new GUIContent(CurrentLang.OpenCloudDashboardText, CurrentLang.OpenCloudDashboardTooltip), GUILayout.Width(205)))
{
EditorUtility.OpenWithDefaultApp(UrlCloudDashboard + Uri.EscapeUriString(this.mailOrAppId));
}
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
}
if (this.photonSetupState == PhotonSetupStates.GoEditPhotonServerSettings)
{
if (!highlightedSettings)
{
highlightedSettings = true;
HighlightSettings();
}
//.........这里部分代码省略.........
开发者ID:osijan,项目名称:cellule,代码行数:101,代码来源:PhotonEditor.cs
示例5: OnGuiSetupCloudAppId
protected virtual void OnGuiSetupCloudAppId()
{
GUILayout.Label(CurrentLang.AppIdLabel);
GUILayout.BeginHorizontal();
this.cloudAppId = EditorGUILayout.TextField(this.cloudAppId);
open = GUILayout.Toggle(open, HelpIcon, GUIStyle.none, GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
if (open) GUILayout.Label(CurrentLang.AppIdInfoLabel);
EditorGUILayout.Separator();
GUILayout.Label(CurrentLang.CloudRegionLabel);
int selectedRegion = ServerSettings.FindRegionForServerAddress(this.photonAddress);
GUILayout.BeginHorizontal();
int toolbarValue = GUILayout.Toolbar(selectedRegion, cloudServerRegionNames); // the enum CloudServerRegion is converted into a string[] in init (toolbar can't use enum)
helpRegion = GUILayout.Toggle(helpRegion, HelpIcon, GUIStyle.none, GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
if (helpRegion) GUILayout.Label(CurrentLang.RegionalServersInfo);
if (selectedRegion != toolbarValue)
{
//Debug.Log("Replacing region: " + selectedRegion + " with: " + toolbarValue);
this.photonAddress = ServerSettings.FindServerAddressForRegion(toolbarValue);
}
EditorGUILayout.Separator();
GUILayout.BeginHorizontal();
if (GUILayout.Button(CurrentLang.CancelButton))
{
GUIUtility.keyboardControl = 0;
this.ReApplySettingsToWindow();
}
if (GUILayout.Button(CurrentLang.SaveButton))
{
GUIUtility.keyboardControl = 0;
this.cloudAppId = this.cloudAppId.Trim();
PhotonEditor.Current.UseCloud(this.cloudAppId, selectedRegion);
PhotonEditor.Save();
EditorUtility.DisplayDialog(CurrentLang.SettingsSavedTitle, CurrentLang.SettingsSavedMessage, CurrentLang.OkButton);
}
GUILayout.EndHorizontal();
GUILayout.Space(20);
GUILayout.Label(CurrentLang.SetupOwnServerLabel);
if (GUILayout.Button(CurrentLang.SelfHostSettingsButton))
{
this.photonAddress = ServerSettings.DefaultServerAddress;
this.photonPort = ServerSettings.DefaultMasterPort;
this.photonSetupState = PhotonSetupStates.SetupSelfHosted;
}
EditorGUILayout.Separator();
GUILayout.Label(CurrentLang.OwnHostCloudCompareLabel);
if (GUILayout.Button(CurrentLang.ComparisonPageButton))
{
Application.OpenURL(UrlCompare);
}
}
开发者ID:kleptodorf,项目名称:Unity-Learning,代码行数:78,代码来源:PhotonEditor.cs
示例6: OnGuiRegisterCloudApp
protected virtual void OnGuiRegisterCloudApp()
{
GUI.skin.label.wordWrap = true;
if (!this.isSetupWizard)
{
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button(CurrentLang.MainMenuButton, GUILayout.ExpandWidth(false)))
{
this.SwitchMenuState(GUIState.Main);
}
GUILayout.EndHorizontal();
GUILayout.Space(15);
}
if (this.photonSetupState == PhotonSetupStates.RegisterForPhotonCloud)
{
GUI.skin.label.fontStyle = FontStyle.Bold;
GUILayout.Label(CurrentLang.ConnectButton);
EditorGUILayout.Separator();
GUI.skin.label.fontStyle = FontStyle.Normal;
GUILayout.Label(CurrentLang.UsePhotonLabel);
EditorGUILayout.Separator();
this.emailAddress = EditorGUILayout.TextField(CurrentLang.EmailLabel, this.emailAddress);
if (GUILayout.Button(CurrentLang.SendButton))
{
GUIUtility.keyboardControl = 0;
this.RegisterWithEmail(this.emailAddress);
}
GUILayout.Space(20);
GUILayout.Label(CurrentLang.SignedUpAlreadyLabel);
if (GUILayout.Button(CurrentLang.SetupButton))
{
this.photonSetupState = PhotonSetupStates.SetupPhotonCloud;
}
EditorGUILayout.Separator();
GUILayout.Label(CurrentLang.RegisterByWebsiteLabel);
if (GUILayout.Button(CurrentLang.AccountWebsiteButton))
{
EditorUtility.OpenWithDefaultApp(UrlAccountPage + Uri.EscapeUriString(this.emailAddress));
}
EditorGUILayout.Separator();
GUILayout.Label(CurrentLang.SelfHostLabel);
if (GUILayout.Button(CurrentLang.SelfHostSettingsButton))
{
this.photonSetupState = PhotonSetupStates.SetupSelfHosted;
}
GUILayout.FlexibleSpace();
if (!InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.Android) || !InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.iPhone))
{
GUILayout.Label(CurrentLang.MobileExportNoteLabel);
}
EditorGUILayout.Separator();
}
else if (this.photonSetupState == PhotonSetupStates.EmailAlreadyRegistered)
{
GUI.skin.label.fontStyle = FontStyle.Bold;
GUILayout.Label(CurrentLang.OopsLabel);
GUI.skin.label.fontStyle = FontStyle.Normal;
GUILayout.Label(CurrentLang.EmailInUseLabel);
if (GUILayout.Button(CurrentLang.SeeMyAccountPageButton))
{
EditorUtility.OpenWithDefaultApp(UrlCloudDashboard + Uri.EscapeUriString(this.emailAddress));
}
EditorGUILayout.Separator();
GUILayout.Label(CurrentLang.KnownAppIdLabel);
GUILayout.BeginHorizontal();
if (GUILayout.Button(CurrentLang.CancelButton))
{
this.photonSetupState = PhotonSetupStates.RegisterForPhotonCloud;
}
if (GUILayout.Button(CurrentLang.SetupButton))
{
this.photonSetupState = PhotonSetupStates.SetupPhotonCloud;
}
GUILayout.EndHorizontal();
}
else if (this.photonSetupState == PhotonSetupStates.SetupPhotonCloud)
{
//.........这里部分代码省略.........
开发者ID:AsifAhmed16,项目名称:Operation-Hatirjheel,代码行数:101,代码来源:PhotonEditor.cs
示例7: SetupGUI
void SetupGUI()
{
GUI.skin.label.wordWrap = true;
if (!isSetupWizard)
{
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button("Close setup", GUILayout.ExpandWidth(false)))
SwitchMenuState(GUIState.Main);
GUILayout.EndHorizontal();
GUILayout.Space(15);
}
if (photonSetupState == PhotonSetupStates._1)
{
GUI.skin.label.fontStyle = FontStyle.Bold;
GUILayout.Label("Connect to Photon Cloud");
GUI.skin.label.fontStyle = FontStyle.Normal;
GUILayout.Label("Your e-mail address is required to access your own free app.");
emailAddress = EditorGUILayout.TextField("Email:", emailAddress);
if (GUILayout.Button("Send"))
{
GUIUtility.keyboardControl = 0;
RegisterWithEmail(emailAddress);
}
EditorGUILayout.Separator();
GUILayout.Label("I am already signed up. Get me to setup.");
if (GUILayout.Button("Setup"))
photonSetupState = PhotonSetupStates._3a;
EditorGUILayout.Separator();
}
else if (photonSetupState == PhotonSetupStates._2)
{
GUI.skin.label.fontStyle = FontStyle.Bold;
GUILayout.Label("Oops!");
GUI.skin.label.fontStyle = FontStyle.Normal;
GUILayout.Label("The provided e-mail-address has already been registered.");
if (GUILayout.Button("Mh, see my account page"))
{
Application.OpenURL(UrlAccountPage + emailAddress);
}
EditorGUILayout.Separator();
GUILayout.Label("Ah, I know my Application ID. Get me to setup.");
GUILayout.BeginHorizontal();
if (GUILayout.Button("Cancel"))
photonSetupState = PhotonSetupStates._1;
if (GUILayout.Button("Setup"))
photonSetupState = PhotonSetupStates._3a;
GUILayout.EndHorizontal();
}
else if (photonSetupState == PhotonSetupStates._3a)
{
// cloud setup
GUI.skin.label.fontStyle = FontStyle.Bold;
GUILayout.Label("Connect to Photon Cloud");
GUI.skin.label.fontStyle = FontStyle.Normal;
EditorGUILayout.Separator();
this.SetupCloudAppIdGui();
this.CompareAndHelpOptionsGui();
}
else if (photonSetupState == PhotonSetupStates._3b)
{
// self-hosting setup
GUI.skin.label.fontStyle = FontStyle.Bold;
GUILayout.Label("Setup own Photon Host");
GUI.skin.label.fontStyle = FontStyle.Normal;
EditorGUILayout.Separator();
this.SetupSelfhostingGui();
this.CompareAndHelpOptionsGui();
}
}
开发者ID:Keos027,项目名称:source,代码行数:85,代码来源:PhotonEditor.cs
示例8: OnGuiSetupCloudAppId
protected virtual void OnGuiSetupCloudAppId()
{
GUILayout.Label("Your AppId");
GUILayout.BeginHorizontal();
this.cloudAppId = EditorGUILayout.TextField(this.cloudAppId);
open = GUILayout.Toggle(open, HelpIcon, GUIStyle.none, GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
if (open) GUILayout.Label("The AppId a Guid that identifies your game in the Photon Cloud. Find it on your dashboard page.");
EditorGUILayout.Separator();
GUILayout.Label("Cloud Region");
int selectedRegion = ServerSettings.FindRegionForServerAddress(this.photonAddress);
GUILayout.BeginHorizontal();
int toolbarValue = GUILayout.Toolbar(selectedRegion, ServerSettings.CloudServerRegionNames);
helpRegion = GUILayout.Toggle(helpRegion, HelpIcon, GUIStyle.none, GUILayout.ExpandWidth(false));
GUILayout.EndHorizontal();
if (helpRegion) GUILayout.Label("Photon Cloud has regional servers. Picking one near your customers improves ping times. You could use more than one but this setup does not support it.");
if (selectedRegion != toolbarValue)
{
//Debug.Log("Replacing region: " + selectedRegion + " with: " + toolbarValue);
this.photonAddress = ServerSettings.FindServerAddressForRegion(toolbarValue);
}
EditorGUILayout.Separator();
GUILayout.BeginHorizontal();
if (GUILayout.Button("Cancel"))
{
GUIUtility.keyboardControl = 0;
this.ReApplySettingsToWindow();
}
if (GUILayout.Button("Save"))
{
GUIUtility.keyboardControl = 0;
this.cloudAppId = this.cloudAppId.Trim();
PhotonEditor.Current.UseCloud(this.cloudAppId, selectedRegion);
PhotonEditor.Save();
EditorUtility.DisplayDialog("Success", "Saved your settings.", "ok");
}
GUILayout.EndHorizontal();
GUILayout.Space(20);
GUILayout.Label("Running my app in the cloud was fun but...\nLet me setup my own Photon server.");
if (GUILayout.Button("Open self-hosting settings"))
{
this.photonAddress = ServerSettings.DefaultServerAddress;
this.photonPort = ServerSettings.DefaultMasterPort;
this.photonSetupState = PhotonSetupStates.SetupSelfHosted;
}
EditorGUILayout.Separator();
GUILayout.Label("I am not quite sure how 'my own host' compares to 'cloud'.");
if (GUILayout.Button("See comparison page"))
{
Application.OpenURL(UrlCompare);
}
}
开发者ID:keaton-freude,项目名称:UnityTowerDefense,代码行数:71,代码来源:PhotonEditor.cs
示例9: RegisterWithEmail
void RegisterWithEmail(string email)
{
EditorUtility.DisplayProgressBar("Connecting", "Connecting to the account service..", 0.5f);
var client = new AccountService(UrlAccountService);
Result defaultResult = new Result() { ReturnCode = -1, Message = "Account Service not available. Please use web-access and 'manual' setup." };
Result result = defaultResult;
try
{
result = client.RegisterByEmail(email);
}
catch (Exception e)
{
Debug.LogError("Error trying to reach the cloud account service. Please use web-access." + e);
}
if (result == null)
{
result = defaultResult;
}
EditorUtility.ClearProgressBar();
if (result.ReturnCode == 0)
{
ServerSetting.UseCloud(result.Message);
this.SavePhotonSettings();
this.ReloadHostingSettingsFromFile();
this.photonSetupState = PhotonSetupStates._3a;
}
else
{
if (result.Message.Contains("Email already registered"))
this.photonSetupState = PhotonSetupStates._2;
else
EditorUtility.DisplayDialog("Error", result.Message, "OK");
}
}
开发者ID:Keos027,项目名称:source,代码行数:37,代码来源:PhotonEditor.cs
示例10: SetupCloudAppIdGui
//3a
void SetupCloudAppIdGui()
{
GUILayout.Label("Your APP ID:");
cloudAPPID = EditorGUILayout.TextField(cloudAPPID);
GUILayout.BeginHorizontal();
if (GUILayout.Button("Cancel"))
{
GUIUtility.keyboardControl = 0;
this.ReloadHostingSettingsFromFile();
}
if (GUILayout.Button("Save"))
{
GUIUtility.keyboardControl = 0;
ServerSetting.UseCloud(this.cloudAPPID);
this.SavePhotonSettings();
EditorUtility.DisplayDialog("Success", "Saved your settings.", "ok");
}
GUILayout.EndHorizontal();
EditorGUILayout.Separator();
GUILayout.Label("Running my app in the cloud was fun but...\nLet me setup my own Photon server.");
if (GUILayout.Button("Switch to own host"))
{
this.photonIP = ServerSettings.DefaultServerAddress;
this.photonPort = ServerSettings.DefaultMasterPort;
photonSetupState = PhotonSetupStates._3b;
}
}
开发者ID:Keos027,项目名称:source,代码行数:35,代码来源:PhotonEditor.cs
示例11: OpenSetup
// SETUP GUI
void OpenSetup()
{
SwitchMenuState(GUIState.Setup);
this.ReloadHostingSettingsFromFile();
switch (ServerSetting.HostType)
{
case ServerSettings.HostingOption.PhotonCloud:
photonSetupState = PhotonSetupStates._3a;
break;
case ServerSettings.HostingOption.SelfHosted:
photonSetupState = PhotonSetupStates._3b;
break;
case ServerSettings.HostingOption.NotSet:
default:
photonSetupState = PhotonSetupStates._1;
break;
}
}
开发者ID:Keos027,项目名称:source,代码行数:21,代码来源:PhotonEditor.cs
示例12: OnGuiSetupCloudAppId
protected virtual void OnGuiSetupCloudAppId()
{
GUILayout.Label("Your APP ID:");
this.cloudAppId = EditorGUILayout.TextField(this.cloudAppId);
GUILayout.BeginHorizontal();
if (GUILayout.Button("Cancel"))
{
GUIUtility.keyboardControl = 0;
this.ReApplySettingsToWindow();
}
int selectedRegion = ServerSettings.FindRegionForServerAddress(this.photonAddress);
if (GUILayout.Button("Save"))
{
GUIUtility.keyboardControl = 0;
this.cloudAppId = this.cloudAppId.Trim();
PhotonEditor.Current.UseCloud(this.cloudAppId, selectedRegion);
PhotonEditor.Save();
EditorUtility.DisplayDialog("Success", "Saved your settings.", "ok");
}
GUILayout.EndHorizontal();
EditorGUILayout.Separator();
GUILayout.BeginHorizontal();
GUILayout.Label("Cloud Region");
int toolbarValue = GUILayout.Toolbar(selectedRegion, ServerSettings.CloudServerRegionNames);
if (selectedRegion != toolbarValue)
{
//Debug.Log("Replacing region: " + selectedRegion + " with: " + toolbarValue);
this.photonAddress = ServerSettings.FindServerAddressForRegion(toolbarValue);
}
GUILayout.EndHorizontal();
EditorGUILayout.Separator();
GUILayout.Label("Running my app in the cloud was fun but...\nLet me setup my own Photon server.");
if (GUILayout.Button("Switch to own host"))
{
this.photonAddress = ServerSettings.DefaultServerAddress;
this.photonPort = ServerSettings.DefaultMasterPort;
this.photonSetupState = PhotonSetupStates.SetupSelfHosted;
}
}
开发者ID:Nixhatter,项目名称:CampusSurvival,代码行数:53,代码来源:PhotonEditor.cs
示例13: RegisterWithEmail
protected virtual void RegisterWithEmail(string email)
{
EditorUtility.DisplayProgressBar(CurrentLang.ConnectionTitle, CurrentLang.ConnectionInfo, 0.5f);
var client = new AccountService();
client.RegisterByEmail(email, RegisterOrigin); // this is the synchronous variant using the static RegisterOrigin. "result" is in the client
EditorUtility.ClearProgressBar();
if (client.ReturnCode == 0)
{
PhotonNetwork.PhotonServerSettings.UseCloud(client.AppId, 0);
PhotonEditor.Save();
this.mailOrAppId = client.AppId;
this.photonSetupState = PhotonSetupStates.GoEditPhotonServerSettings;
}
else
{
Debug.LogWarning(client.Message);
if (client.Message.Contains("registered"))
{
PhotonNetwork.PhotonServerSettings.UseCloud("");
PhotonEditor.Save();
this.photonSetupState = PhotonSetupStates.EmailAlreadyRegistered;
}
else
{
EditorUtility.DisplayDialog(CurrentLang.ErrorTextTitle, client.Message, CurrentLang.OkButton);
PhotonNetwork.PhotonServerSettings.UseCloud("");
PhotonEditor.Save();
this.photonSetupState = PhotonSetupStates.RegisterForPhotonCloud;
}
}
}
开发者ID:osijan,项目名称:cellule,代码行数:32,代码来源:PhotonEditor.cs
示例14: UiSetupApp
protected virtual void UiSetupApp()
{
GUI.skin.label.wordWrap = true;
if (!this.isSetupWizard)
{
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button(CurrentLang.MainMenuButton, GUILayout.ExpandWidth(false)))
{
this.photonSetupState = PhotonSetupStates.MainUi;
}
GUILayout.EndHorizontal();
}
// setup header
UiTitleBox(CurrentLang.SetupWizardTitle, BackgroundImage);
// setup info text
GUI.skin.label.richText = true;
GUILayout.Label(CurrentLang.SetupWizardInfo);
// input of appid or mail
EditorGUILayout.Separator();
GUILayout.Label(CurrentLang.EmailOrAppIdLabel);
this.mailOrAppId = EditorGUILayout.TextField(this.mailOrAppId).Trim(); // note: we trim all input
if (this.mailOrAppId.Contains("@"))
{
// this should be a mail address
this.minimumInput = (this.mailOrAppId.Length >= 5 && this.mailOrAppId.Contains("."));
this.useMail = this.minimumInput;
this.useAppId = false;
}
else
{
// this should be an appId
this.minimumInput = ServerSettingsInspector.IsAppId(this.mailOrAppId);
this.useMail = false;
this.useAppId = this.minimumInput;
}
// button to skip setup
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button(CurrentLang.SkipButton, GUILayout.Width(100)))
{
this.photonSetupState = PhotonSetupStates.GoEditPhotonServerSettings;
this.useSkip = true;
this.useMail = false;
this.useAppId = false;
}
// SETUP button
EditorGUI.BeginDisabledGroup(!this.minimumInput);
if (GUILayout.Button(CurrentLang.SetupButton, GUILayout.Width(100)))
{
this.useSkip = false;
GUIUtility.keyboardControl = 0;
if (this.useMail)
{
RegisterWithEmail(this.mailOrAppId); // sets state
}
if (this.useAppId)
{
this.photonSetupState = PhotonSetupStates.GoEditPhotonServerSettings;
Undo.RecordObject(PhotonNetwork.PhotonServerSettings, "Update PhotonServerSettings for PUN");
PhotonNetwork.PhotonServerSettings.UseCloud(this.mailOrAppId);
PhotonEditor.SaveSettings();
}
}
EditorGUI.EndDisabledGroup();
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
// existing account needs to fetch AppId online
if (this.photonSetupState == PhotonSetupStates.EmailAlreadyRegistered)
{
// button to open dashboard and get the AppId
GUILayout.Space(15);
GUILayout.Label(CurrentLang.AlreadyRegisteredInfo);
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button(new GUIContent(CurrentLang.OpenCloudDashboardText, CurrentLang.OpenCloudDashboardTooltip), GUILayout.Width(205)))
{
Application.OpenURL(UrlCloudDashboard + Uri.EscapeUriString(this.mailOrAppId));
this.mailOrAppId = "";
}
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
}
if (this.photonSetupState == PhotonSetupStates.GoEditPhotonServerSettings)
{
if (!this.highlightedSettings)
{
this.highlightedSettings = true;
HighlightSettings();
}
//.........这里部分代码省略.........
开发者ID:2ty,项目名称:race3d,代码行数:101,代码来源:PhotonEditor.cs
示例15: SetupSelfhostingGui
//3b
void SetupSelfhostingGui()
{
GUILayout.Label("Your Photon Host");
photonIP = EditorGUILayout.TextField("IP:", photonIP);
photonPort = EditorGUILayout.IntField("Port:", photonPort);
//photonProtocol = (ExitGames.Client.Photon.ConnectionProtocol)EditorGUILayout.EnumPopup("Protocol:", photonProtocol);
GUILayout.BeginHorizontal();
if (GUILayout.Button("Cancel"))
{
GUIUtility.keyboardControl = 0;
this.ReloadHostingSettingsFromFile();
}
if (GUILayout.Button("Save"))
{
GUIUtility.keyboardControl = 0;
ServerSetting.UseMyServer(this.photonIP, this.photonPort, null);
this.SavePhotonSettings();
EditorUtility.DisplayDialog("Success", "Saved your settings.", "ok");
}
GUILayout.EndHorizontal();
EditorGUILayout.Separator();
GUILayout.Label("Running my own server is too much hassle..\nI want to give Photon's free app a try.");
if (GUILayout.Button("Get the free cloud app"))
{
this.cloudAPPID = "";
photonSetupState = PhotonSetupStates._1;
}
}
开发者ID:Keos027,项目名称:source,代码行数:36,代码来源:PhotonEditor.cs
示例16: OnGuiRegisterCloudApp
protected virtual void OnGuiRegisterCloudApp()
{
GUI.skin.label.wordWrap = true;
if (!this.isSetupWizard)
{
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button("Main Menu", GUILayout.ExpandWidth(false)))
{
this.SwitchMenuState(GUIState.Main);
}
GUILayout.EndHorizontal();
GUILayout.Space(15);
}
if (this.photonSetupState == PhotonSetupStates.RegisterForPhotonCloud)
{
GUI.skin.label.fontStyle = FontStyle.Bold;
GUILayout.Label("Connect to Photon Cloud");
EditorGUILayout.Separator();
GUI.skin.label.fontStyle = FontStyle.Normal;
GUILayout.Label("Using the Photon Cloud is free for development. If you don't have an account yet, enter your email and register.");
EditorGUILayout.Separator();
this.emailAddress = EditorGUILayout.TextField("Email:", this.emailAddress);
if (GUILayout.Button("Send"))
{
GUIUtility.keyboardControl = 0;
this.RegisterWithEmail(this.emailAddress);
}
GUILayout.Space(20);
GUILayout.Label("I am already signed up. Let me enter my AppId.");
if (GUILayout.Button("Setup"))
{
this.photonSetupState = PhotonSetupStates.SetupPhotonCloud;
}
EditorGUILayout.Separator();
GUILayout.Label("I want to register by a website.");
if (GUILayout.Button("Open account website"))
{
EditorUtility.OpenWithDefaultApp(UrlAccountPage + Uri.EscapeUriString(this.emailAddress));
}
EditorGUILayout.Separator();
GUILayout.Label("I want to host my own server. Let me set it up.");
if (GUILayout.Button("Open self-hosting settings"))
{
this.photonAddress = ServerSettings.DefaultServerAddress;
this.photonPort = ServerSettings.DefaultMasterPort;
this.photonSetupState = PhotonSetupStates.SetupSelfHosted;
}
GUILayout.FlexibleSpace();
if (!InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.Android) || !InternalEditorUtility.HasAdvancedLicenseOnBuildTarget(BuildTarget.iPhone))
{
GUILayout.Label("Note: Export to mobile will require iOS Pro / Android Pro.");
}
EditorGUILayout.Separator();
}
else if (this.photonSetupState == PhotonSetupStates.EmailAlreadyRegistered)
{
GUI.skin.label.fontStyle = FontStyle.Bold;
GUILayout.Label("Oops!");
GUI.skin.label.fontStyle = FontStyle.Normal;
GUILayout.Label("The provided e-mail-address has already been registered.");
if (GUILayout.Button("Mh, see my account page"))
{
EditorUtility.OpenWithDefaultApp(UrlCloudDashboard + Uri.EscapeUriString(this.emailAddress));
}
EditorGUILayout.Separator();
GUILayout.Label("Ah, I know my Application ID. Get me to setup.");
GUILayout.BeginHorizontal();
if (GUILayout.Button("Cancel"))
{
this.photonSetupState = PhotonSetupStates.RegisterForPhotonCloud;
}
if (GUILayout.Button("Setup"))
{
this.photonSetupState = PhotonSetupStates.SetupPhotonCloud;
}
GUILayout.EndHorizontal();
}
else if (this.photonSetupState == PhotonSetupStates.SetupPhotonCloud)
{
// cloud setup
//.........这里部分代码省略.........
开发者ID:keaton-freude,项目名称:UnityTowerDefense,代码行数:101,代码来源:PhotonEditor.cs
示例17: OnGuiRegisterCloudApp
protected virtual void OnGuiRegisterCloudApp()
{
GUI.skin.label.wordWrap = true;
if (!this.isSetupWizard)
{
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button("Close setup", GUILayout.ExpandWidth(false)))
{
this.SwitchMenuState(GUIState.Main);
}
GUILayout.EndHorizontal();
GUILayout.Space(15);
}
if (this.photonSetupState == PhotonSetupStates.RegisterForPhotonCloud)
{
GUI.skin.label.fontStyle = FontStyle.Bold;
GUILayout.Label("Connect to Photon Cloud");
GUI.skin.label.fontStyle = FontStyle.Normal;
GUILayout.Label("Your e-mail address is required to access your own free app.");
this.emailAddress = EditorGUILayout.TextField("Email:", this.emailAddress);
if (GUILayout.Button("Send"))
{
GUIUtility.keyboardControl = 0;
this.RegisterWithEmail(this.emailAddress);
}
EditorGUILayout.Separator();
GUILayout.Label("I am already signed up. Let me enter my AppId.");
if (GUILayout.Button("Setup"))
{
this.photonSetupState = PhotonSetupStates.SetupPhotonCloud;
}
GUILayout.Label("I want to register by a website.");
if (GUILayout.Button("Open account website"))
{
EditorUtility.OpenWithDefaultApp(UrlAccountPage + Uri.EscapeUriString(this.emailAddress));
}
EditorGUILayout.Separator();
}
else if (this.photonSetupState == PhotonSetupStates.EmailAlreadyRegistered)
{
GUI.skin.label.fontStyle = FontStyle.Bold;
GUILayout.Label("Oops!");
GUI.skin.label.fontStyle = FontStyle.Normal;
GUILayout.Label("The provided e-mail-address has already been registered.");
if (GUILayout.Button("Mh, see my account page"))
{
EditorUtility.OpenWithDefaultApp(UrlAccountPage + Uri.EscapeUriString(this.emailAddress));
}
EditorGUILayout.Separator();
GUILayout.Label("Ah, I know my Application ID. Get me to setup.");
|
请发表评论