BITKit/Src/Unity/Scripts/Assets/YooAssetVersionEvent.cs

21 lines
536 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using YooAsset;
namespace BITKit
{
public class YooAssetVersionEvent : MonoBehaviour
{
[SerializeReference, SubclassSelector] private IReference packageName;
[SerializeField] private UnityEvent<string> output;
private void Start()
{
var package = YooAssets.GetPackage(packageName.Value);
output?.Invoke(package.GetPackageVersion());
}
}
}