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

@@ -0,0 +1,30 @@
using System;
using System.Collections;
using System.Collections.Generic;
using BITKit.Mod;
using Cysharp.Threading.Tasks;
using UnityEngine;
using YooAsset;
using Object = UnityEngine.Object;
namespace BITKit.IO
{
public class YooAssetModHelper : MonoBehaviour
{
private void OnEnable()
{
ModService.LoadAssetAsyncFactory += LoadAsset;
}
private void OnDisable()
{
ModService.LoadAssetAsyncFactory -= LoadAsset;
}
private static async UniTask<object> LoadAsset(string arg)
{
var handle = YooAssets.LoadAssetAsync(arg);
await handle;
return handle.AssetObject;
}
}
}