| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using UnityEngine;
- [UnityEngine.Scripting.APIUpdating.MovedFrom(true, sourceNamespace: "", sourceAssembly: "AppRuntimes", sourceClassName: "AppSettings")]
- public sealed class AppSettings : ScriptableObject
- {
- private static AppSettings instance;
- public static AppSettings Instance
- {
- get
- {
- if(!instance)
- {
- instance = Resources.Load<AppSettings>("AppSettings");
- }
- return instance;
- }
- }
- public string AppAddress = string.Empty;
- public string AppChannel = string.Empty;
- public string PrivacyUrl = string.Empty;
- [Tooltip("Absolute HTTP(S) URL of the hot patch resource directory or manifest.json")]
- public string DownloadUrl = string.Empty;
- [HideInInspector] public bool UseLocalHotPatchResources;
- [Tooltip("Hot patch assembly name, saved after selecting an asmdef in the AppSettings window")]
- public string HotPatchAssemblyName = string.Empty;
- [Tooltip("Game scene to open after loading the hot patch. Built as a separate scene AssetBundle and excluded from the Player scene list.")]
- public string GameSceneName = string.Empty;
- public static string RequireGameSceneName()
- {
- var settings = Resources.Load<AppSettings>("AppSettings");
- if (settings == null || string.IsNullOrWhiteSpace(settings.GameSceneName))
- throw new System.InvalidOperationException("Enter the game scene name in AppSettings and click Save.");
- return settings.GameSceneName.Trim();
- }
- public static string RequireHotPatchAssemblyName()
- {
- var settings = Resources.Load<AppSettings>("AppSettings");
- if (settings == null || string.IsNullOrWhiteSpace(settings.HotPatchAssemblyName))
- throw new System.InvalidOperationException("Select the hot patch assembly in AppSettings and click Save.");
- return settings.HotPatchAssemblyName;
- }
- }
|