Netcode Bootstrap

This commit is contained in:
Luis Gonzalez
2026-05-31 14:27:52 -07:00
parent 99d8d2d2a9
commit 7fa77ce821
1813 changed files with 2921554 additions and 84 deletions
@@ -0,0 +1,58 @@
using Unity.Collections;
using Unity.Entities;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace Rukhanka.DebugDrawer
{
[UpdateInGroup(typeof(SimulationSystemGroup), OrderFirst = true)]
[WorldSystemFilter(WorldSystemFilterFlags.LocalSimulation | WorldSystemFilterFlags.ClientSimulation)]
public partial class RukhankaDebugDrawerFrameStartSystem : SystemBase
{
private DrawerManagedSingleton ds;
protected override void OnCreate()
{
ds = new DrawerManagedSingleton();
if (ds.IsValid())
{
var e = EntityManager.CreateSingleton(ds, new FixedString64Bytes("Rukhanka.DebugDrawer.Singleton"));
var dw = Drawer.Create(ds);
EntityManager.AddComponentData(e, dw);
}
}
protected override void OnUpdate()
{
if (!SystemAPI.ManagedAPI.TryGetSingleton<DrawerManagedSingleton>(out var ds))
return;
ds.BeginFrame();
var dw = Drawer.Create(ds);
SystemAPI.SetSingleton(dw);
}
protected override void OnDestroy()
{
if (SystemAPI.ManagedAPI.TryGetSingleton<DrawerManagedSingleton>(out var ds))
ds.Dispose();
}
}
///===============================================================================================================///
[UpdateInGroup(typeof(PresentationSystemGroup), OrderLast = true)]
[WorldSystemFilter(WorldSystemFilterFlags.LocalSimulation | WorldSystemFilterFlags.ClientSimulation)]
public partial class RukhankaDebugDrawerFrameEndSystem : SystemBase
{
protected override void OnUpdate()
{
Dependency.Complete();
if (SystemAPI.ManagedAPI.TryGetSingleton<DrawerManagedSingleton>(out var ds))
{
ds.EndFrame();
SystemAPI.SetSingleton(new Drawer());
}
}
}
}