34 lines
763 B
C#
34 lines
763 B
C#
|
namespace LyraApi.Asset;
|
||
|
|
||
|
public class Handle<T>(UntypedHandle handle) where T : IAssetHandle
|
||
|
{
|
||
|
internal UntypedHandle inner = handle;
|
||
|
|
||
|
public bool Watched { get => inner.Watched; set => inner.Watched = value; }
|
||
|
public ulong Version { get => inner.Version; }
|
||
|
public Guid Uuid { get => inner.Uuid; }
|
||
|
public string Path { get => inner.Path; }
|
||
|
public bool IsLoaded { get => inner.IsLoaded; }
|
||
|
|
||
|
public void WaitForLoad()
|
||
|
{
|
||
|
inner.WaitForLoad();
|
||
|
}
|
||
|
|
||
|
public void WaitForLoadRecursive()
|
||
|
{
|
||
|
inner.WaitForLoadRecursive();
|
||
|
}
|
||
|
|
||
|
public T? GetData()
|
||
|
{
|
||
|
if (IsLoaded)
|
||
|
{
|
||
|
return (T?)T.FromRawHandle(inner);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
return default;
|
||
|
}
|
||
|
}
|
||
|
}
|