lyra-wasm-scripting-test/guests/csharp/dotnet-guest-test/LyraApi/Engine/DeltaTime.cs

23 lines
637 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 => null,
WorldResourceResult.BYTES => MarshalUtils.FromBytes<DeltaTime>(result.AsBytes),
_ => null,
};
}
}