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 (NetworkSetting != null) { Open(); Debug.Debugger.Log("Already exist NetworkSetting."); } else { NetworkSetting = CreateInstance <MatchingSettings>(); AssetDatabase.CreateAsset(NetworkSetting, UniP2PManager.DefaultMatchingSettingsPath); AssetDatabase.Refresh(); } }
static void Load() { NetworkSetting = AssetDatabase.LoadAssetAtPath <MatchingSettings>(UniP2PManager.DefaultMatchingSettingsPath); }