24 lines
828 B
C#
24 lines
828 B
C#
using BITFALL;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace BITKit
|
|
{
|
|
public static class ItemExtensions
|
|
{
|
|
public static ScriptableItem GetAssetable(this IBasicItem self)
|
|
{
|
|
var task = YooAsset.YooAssets.LoadAssetAsync<ScriptableItem>(self.AddressablePath);
|
|
task.WaitForAsyncComplete();
|
|
return task.AssetObject.As<ScriptableItem>();
|
|
//return Addressables.LoadAssetAsync<AssetableItem>(self.AddressablePath).WaitForCompletion();
|
|
}
|
|
public static ScriptableItem GetAssetable(string address)
|
|
{
|
|
var task = YooAsset.YooAssets.LoadAssetAsync<ScriptableItem>(address);
|
|
task.WaitForAsyncComplete();
|
|
return task.AssetObject.As<ScriptableItem>();
|
|
}
|
|
}
|
|
} |