update core / rename GameObjectRef to UnityGameObject

This commit is contained in:
Mikhail 2023-04-01 22:30:49 +08:00
parent 980d7b0f6a
commit 6f3011270a
3 changed files with 10 additions and 10 deletions

View File

@ -7,23 +7,23 @@
public class EcsLateRunSystemRunner : EcsRunner<IEcsLateRunSystem>, IEcsLateRunSystem public class EcsLateRunSystemRunner : EcsRunner<IEcsLateRunSystem>, IEcsLateRunSystem
{ {
#if DEBUG #if DEBUG && !DISABLE_DRAGONECS_DEBUG
private EcsProfilerMarker[] _markers; private EcsProfilerMarker[] _markers;
#endif #endif
public void LateRun(EcsPipeline pipeline) public void LateRun(EcsPipeline pipeline)
{ {
#if DEBUG #if DEBUG && !DISABLE_DRAGONECS_DEBUG
for (int i = 0; i < targets.Length; i++) for (int i = 0; i < targets.Length; i++)
{ {
using (_markers[i].Auto()) using (_markers[i].Auto())
targets[i].LateRun(pipeline); targets[i].LateRun(pipeline);
} }
#else #else
foreach (var item in targets) item.LateRun(systems); foreach (var item in targets) item.LateRun(pipeline);
#endif #endif
} }
#if DEBUG #if DEBUG && !DISABLE_DRAGONECS_DEBUG
protected override void OnSetup() protected override void OnSetup()
{ {
_markers = new EcsProfilerMarker[targets.Length]; _markers = new EcsProfilerMarker[targets.Length];
@ -52,12 +52,12 @@
} }
public class EcsFixedRunSystemRunner : EcsRunner<IEcsFixedRunSystem>, IEcsFixedRunSystem public class EcsFixedRunSystemRunner : EcsRunner<IEcsFixedRunSystem>, IEcsFixedRunSystem
{ {
#if DEBUG #if DEBUG && !DISABLE_DRAGONECS_DEBUG
private EcsProfilerMarker[] _markers; private EcsProfilerMarker[] _markers;
#endif #endif
public void FixedRun(EcsPipeline pipeline) public void FixedRun(EcsPipeline pipeline)
{ {
#if DEBUG #if DEBUG && !DISABLE_DRAGONECS_DEBUG
for (int i = 0; i < targets.Length; i++) for (int i = 0; i < targets.Length; i++)
{ {
using (_markers[i].Auto()) using (_markers[i].Auto())
@ -68,7 +68,7 @@
#endif #endif
} }
#if DEBUG #if DEBUG && !DISABLE_DRAGONECS_DEBUG
protected override void OnSetup() protected override void OnSetup()
{ {
_markers = new EcsProfilerMarker[targets.Length]; _markers = new EcsProfilerMarker[targets.Length];

View File

@ -7,7 +7,7 @@ using UnityEditor;
namespace DCFApixels.DragonECS namespace DCFApixels.DragonECS
{ {
[DebugColor(DebugColor.Cyan)] [DebugColor(DebugColor.Cyan)]
public struct GameObjectRef public struct UnityGameObject
{ {
public GameObject gameObject; public GameObject gameObject;
public Transform transform; public Transform transform;
@ -18,7 +18,7 @@ namespace DCFApixels.DragonECS
get => gameObject.name; get => gameObject.name;
} }
public GameObjectRef(GameObject gameObject) public UnityGameObject(GameObject gameObject)
{ {
this.gameObject = gameObject; this.gameObject = gameObject;
transform = gameObject.transform; transform = gameObject.transform;
@ -65,7 +65,7 @@ namespace DCFApixels.DragonECS
ent result = self.NewEntity(); ent result = self.NewEntity();
GameObject newGameObject = new GameObject(name); GameObject newGameObject = new GameObject(name);
newGameObject.AddComponent<EcsEntity>()._entity = result; newGameObject.AddComponent<EcsEntity>()._entity = result;
result.Write<GameObjectRef>() = new GameObjectRef(newGameObject); result.Write<UnityGameObject>() = new UnityGameObject(newGameObject);
#if UNITY_EDITOR #if UNITY_EDITOR
if (icon != GameObjectIcon.NONE) if (icon != GameObjectIcon.NONE)