A stable modding interface between Techblox and mods https://mod.exmods.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
643B

  1. using GamecraftModdingAPI.Players;
  2. using Svelto.ECS.EntityStructs;
  3. using Unity.Mathematics;
  4. namespace GamecraftModdingAPI
  5. {
  6. public class FlyCam
  7. {
  8. private static FlyCamEngine Engine;
  9. public uint Id { get; }
  10. public FlyCam(uint id) => Id = id;
  11. public unsafe float3 Position
  12. {
  13. get => Engine.GetComponent<PositionEntityStruct>(Id).Map(pos => &pos->position);
  14. set => Engine.GetComponent<PositionEntityStruct>(Id).Map(pos => &pos->position).Set(value);
  15. }
  16. public static void Init()
  17. {
  18. Engine = new FlyCamEngine();
  19. }
  20. }
  21. }