1
This commit is contained in:
43
Assets/BITKit/Unity/Scripts/Mod/UnityModLoadAssetTester.cs
Normal file
43
Assets/BITKit/Unity/Scripts/Mod/UnityModLoadAssetTester.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user