Spaces:
Runtime error
Runtime error
using System; | |
using Photon.Deterministic; | |
using Quantum.Task; | |
namespace Quantum | |
{ | |
public unsafe class TraktorInputSystem : SystemThreadedFilter<TraktorInputSystem.Filter>, ISignalOnComponentAdded<Traktor> | |
{ | |
public struct Filter | |
{ | |
public EntityRef Entity; | |
public Transform3D* Transform; | |
public Traktor* Traktor; | |
} | |
public void OnAdded(Frame frame, EntityRef entity, Traktor* traktor) | |
{ | |
EntityRef sphere = frame.Create(traktor->SpherePrototype); | |
traktor->Sphere = sphere; | |
} | |
public override void Update(FrameThreadSafe frame, ref Filter filter) | |
{ | |
Input input = default; | |
if (frame.TryGetPointer<Controller>(filter.Entity, out var controller)) | |
{ | |
input = *((Frame)frame).GetPlayerInput(controller->Player); | |
} | |
filter.Traktor->Update(frame, ref filter, input); | |
} | |
} | |
} | |