| 1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using System.Threading;
- using Cysharp.Threading.Tasks;
- namespace HotPatch
- {
- public sealed class HotPatchLaunchResources : ILaunchResources
- {
- public string GameSceneName => AppSettings.RequireGameSceneName();
- public string LoadedScenePath => HotPatchService.LoadedScenePath;
- public string LoadedVersion => HotPatchService.LoadedVersion;
- public bool HasLoadedAssembly => HotPatchService.LoadedAssembly != null;
- public bool RequiresRestart => HotPatchService.RequiresRestart;
- public async UniTask LoadAsync(Action<string, float> progress, CancellationToken cancellationToken)
- {
- await HotPatchService.LoadAndInitializeAsync(value => progress?.Invoke(value.Stage, value.Value), cancellationToken);
- }
- public void MarkEntryFailed() => HotPatchService.MarkEntryFailed();
- #if UNITY_EDITOR
- public bool UseEditorSceneLoading
- {
- get
- {
- var settings = UnityEngine.Resources.Load<AppSettings>("AppSettings");
- return !settings.UseLocalHotPatchResources && string.IsNullOrWhiteSpace(settings.DownloadUrl);
- }
- }
- public void InitializeEditor() => HotPatchService.InvokeInitialization(System.Reflection.Assembly.Load("AppRuntimes.Sources.Editor"));
- #endif
- }
- }
|