23 lines
641 B
C#
23 lines
641 B
C#
|
using System.Runtime.InteropServices;
|
||
|
using LyraApi;
|
||
|
using LyraApi.Ecs;
|
||
|
using static ExampleWorld.wit.imports.lyra.api.IEcs;
|
||
|
|
||
|
namespace LyraApi.Engine;
|
||
|
|
||
|
[StructLayout(LayoutKind.Sequential)]
|
||
|
public struct DeltaTime : IResource {
|
||
|
public float Seconds;
|
||
|
|
||
|
public static ulong TypeId => 83716348954;
|
||
|
|
||
|
public static object? FromWasmResult(WorldResourceResult result)
|
||
|
{
|
||
|
return result.Tag switch
|
||
|
{
|
||
|
WorldResourceResult.NONE | WorldResourceResult.WASM_RESOURCE_REP => null,
|
||
|
WorldResourceResult.BYTES => MarshalUtils.FromBytes<DeltaTime>(result.AsBytes),
|
||
|
_ => null,
|
||
|
};
|
||
|
}
|
||
|
}
|