public static void SettingLoad() { if (!isLoaded) { MatchingSettings = Resources.Load <MatchingSettings>(MatchingSettingsFileName); AdvancedSettings = Resources.Load <AdvancedSettings>(AdvancedSettingsFileName); foreach (var console in AdvancedSettings.Consoles) { switch (console) { case ConsoleType.System: Debugger.SetConsole(new SystemConsole()); break; case ConsoleType.Unity: Debugger.SetConsole(new UnityConsole()); break; case ConsoleType.Extension: Debugger.SetConsole(new ExConsole()); break; } } switch (AdvancedSettings.SocketType) { case SocketType.dotnetUDP: Socket = new SocketUdp(); break; } isLoaded = true; Debugger.Log("[UniP2PManager] SettingLoaded"); } }
static void Create() { Load(); if (AdvancedSettings != null) { Open(); Debug.Debugger.Log("Already exist NetworkSetting."); } else { AdvancedSettings = CreateInstance <AdvancedSettings>(); AssetDatabase.CreateAsset(AdvancedSettings, UniP2PManager.DefaultAdvancedSettingsPath); AssetDatabase.Refresh(); } }
static void Load() { AdvancedSettings = AssetDatabase.LoadAssetAtPath <AdvancedSettings>(UniP2PManager.DefaultAdvancedSettingsPath); }