44 lines
898 B
C#
44 lines
898 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using BITKit.IO;
|
|
using Cysharp.Threading.Tasks;
|
|
using UnityEngine;
|
|
using YooAsset;
|
|
|
|
namespace BITKit.Mod
|
|
{
|
|
public class UnityModLoadAssetTester : MonoBehaviour
|
|
{
|
|
|
|
|
|
[SerializeField] private bool initOnStart;
|
|
[SerializeReference, SubclassSelector] private IReference packageName;
|
|
[SerializeReference, SubclassSelector] private IReference path;
|
|
[SerializeReference, SubclassSelector] private IReference[] testTag;
|
|
private void Start()
|
|
{
|
|
if (initOnStart)
|
|
{
|
|
Initialize();
|
|
}
|
|
}
|
|
[BIT]
|
|
private void Initialize()
|
|
{
|
|
var mod = new LoadAssetMod()
|
|
{
|
|
Name = "LoadAssetMod",
|
|
PackageName = packageName.Value,
|
|
FolderPath = $"file://{path.Value}" ,
|
|
Tags = testTag.Cast()
|
|
};
|
|
ModService.Install(mod);
|
|
ModService.Load(mod);
|
|
}
|
|
}
|
|
|
|
}
|