ServerSettingsMissingLabel
How do I use Server Settings Missing Label
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
836 | Debug.LogError(CurrentLang.ServerSettingsMissingLabel); | 1 |
File name: PhotonEditor.cs
Copy
827 {
828 get
829 {
830 if (currentSettings == null)
831 {
832 // find out if ServerSettings can be instantiated (existing script check)
833 ScriptableObject serverSettingTest = CreateInstance("ServerSettings");
834 if (serverSettingTest == null)
835 {
836 Debug.LogError(CurrentLang.ServerSettingsMissingLabel);
837 return null;
838 }
839 DestroyImmediate(serverSettingTest);
840
841 // try to load settings from file
842 ReLoadCurrentSettings();
843
844 // if still not loaded, create one
845 if (currentSettings == null)
846 {
847 string settingsPath = Path.GetDirectoryName(PhotonNetwork.serverSettingsAssetPath);
848 if (!Directory.Exists(settingsPath))
849 {
850 Directory.CreateDirectory(settingsPath);
851 AssetDatabase.ImportAsset(settingsPath);
852 }
853
854 currentSettings = (ServerSettings)ScriptableObject.CreateInstance("ServerSettings");
855 if (currentSettings != null)
856 {
857 AssetDatabase.CreateAsset(currentSettings, PhotonNetwork.serverSettingsAssetPath);
858 }
859 else
860 {
861 Debug.LogError(CurrentLang.ServerSettingsMissingLabel);
862 }
863 }
864
865 // settings were loaded or created. set this editor's initial selected region now (will be changed in GUI)
866 if (currentSettings != null)
867 {
868 selectedRegion = currentSettings.PreferredRegion;
869 }
870 }
871
872 return currentSettings;
873 }
874
875 protected set
876 {
877 currentSettings = value;
878 }
879 }
ServerSettingsMissingLabel 128 lượt xem
Gõ tìm kiếm nhanh...