1
This commit is contained in:
@@ -126,7 +126,7 @@ namespace BITKit.Mod
|
||||
}
|
||||
}
|
||||
|
||||
public class ModService
|
||||
public partial class ModService
|
||||
{
|
||||
public static async UniTask<ModPackage[]> SearchPackages()
|
||||
{
|
||||
|
26
Src/Core/Mod/ModService_IO.cs
Normal file
26
Src/Core/Mod/ModService_IO.cs
Normal 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}");
|
||||
}
|
||||
}
|
||||
}
|
11
Src/Core/Mod/ModService_IO.cs.meta
Normal file
11
Src/Core/Mod/ModService_IO.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c63d2ab8d0ff2304e980bb1e0585c903
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user