可导出的第一版

This commit is contained in:
SoulliesOfficial
2025-11-16 09:56:20 -05:00
parent 5fe665d0ce
commit 97a3c86465
33 changed files with 271 additions and 200 deletions

View File

@@ -31,13 +31,29 @@ namespace SLSFramework.UModAssistance
{
await Task.Yield();
}
if (!host.IsSuccessful)
{
throw new Exception($"Failed to load mod '{modName}' asynchronously");
Debug.LogError($"[ModLoader] Mod load operation for '{modName}' failed (hostTask.IsSuccessful == false).");
throw new Exception($"Failed to load mod '{modName}' asynchronously (Operation Failed)");
}
ModHost modHost = host.Result;
if (modHost == null || !modHost.IsModLoaded)
{
if (modHost != null)
{
var errorMessage = modHost.LoadResult.Message;
Debug.LogError($"[ModLoader] Mod load operation for '{modName}' failed: {errorMessage}");
}
throw new Exception($"Failed to load mod '{modName}' asynchronously (ModHost is null or not loaded)");
}
LoadedMods.Add(modName, host.Result);
Debug.Log($"Mod '{modName}' async loaded successfully.");
return host.Result;
return modHost;
}
}