TechbloxModdingAPI/GamecraftModdingAPI/FlyCam.cs
NorbiPeti 55b38f1678
Start working on FlyCam and create an overcomplicated struct
Just some native code that's totally unnecessary
2021-04-26 03:12:22 +02:00

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();
}
}
}