This commit is contained in:
CortexCore
2024-11-03 16:38:17 +08:00
parent 056e2cada5
commit 4ba741408d
4693 changed files with 2445 additions and 5443 deletions

View File

@@ -126,7 +126,7 @@ namespace BITKit.Mod
}
}
public class ModService
public partial class ModService
{
public static async UniTask<ModPackage[]> SearchPackages()
{

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
namespace BITKit.Mod
{
public partial class ModService
{
public static Func<string, UniTask<object>> LoadAssetAsyncFactory;
public static async UniTask<T> LoadAsset<T>(string location) where T : class
{
foreach (var func in LoadAssetAsyncFactory.CastAsFunc())
{
var value = await func.Invoke(location);
if (value is T value1)
{
return value1;
}
}
throw new Exception($"Asset not found: {location}");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c63d2ab8d0ff2304e980bb1e0585c903
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: