26 lines
No EOL
643 B
C#
26 lines
No EOL
643 B
C#
using GamecraftModdingAPI.Players;
|
|
using Svelto.ECS.EntityStructs;
|
|
using Unity.Mathematics;
|
|
|
|
namespace GamecraftModdingAPI
|
|
{
|
|
public class FlyCam
|
|
{
|
|
private static FlyCamEngine Engine;
|
|
|
|
public uint Id { get; }
|
|
|
|
public FlyCam(uint id) => Id = id;
|
|
|
|
public unsafe float3 Position
|
|
{
|
|
get => Engine.GetComponent<PositionEntityStruct>(Id).Map(pos => &pos->position);
|
|
set => Engine.GetComponent<PositionEntityStruct>(Id).Map(pos => &pos->position).Set(value);
|
|
}
|
|
|
|
public static void Init()
|
|
{
|
|
Engine = new FlyCamEngine();
|
|
}
|
|
}
|
|
} |