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

View File

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