update EntitySlotInfo

This commit is contained in:
DCFApixels 2025-05-09 19:45:01 +08:00
parent 84401b875d
commit a7f269a0f2
3 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,5 @@
#if UNITY_EDITOR #if UNITY_EDITOR
using DCFApixels.DragonECS.Core.Unchecked;
using DCFApixels.DragonECS.Unity.Internal; using DCFApixels.DragonECS.Unity.Internal;
using System.Reflection; using System.Reflection;
using UnityEditor; using UnityEditor;
@ -50,7 +51,7 @@ namespace DCFApixels.DragonECS.Unity.Editors
SerializedProperty fulleProperty = property.FindPropertyRelative("_full"); SerializedProperty fulleProperty = property.FindPropertyRelative("_full");
EntitySlotInfo entity = new EntitySlotInfo(fulleProperty.longValue); EntitySlotInfo entity = new EntitySlotInfo(fulleProperty.longValue);
EcsWorld.TryGetWorld(entity.world, out EcsWorld world); EcsWorld.TryGetWorld(entity.worldID, out EcsWorld world);
if (drawFoldout && isExpanded) if (drawFoldout && isExpanded)
{ {

View File

@ -1,4 +1,5 @@
#if UNITY_EDITOR #if UNITY_EDITOR
using DCFApixels.DragonECS.Core.Unchecked;
using DCFApixels.DragonECS.Unity.Editors.X; using DCFApixels.DragonECS.Unity.Editors.X;
using DCFApixels.DragonECS.Unity.Internal; using DCFApixels.DragonECS.Unity.Internal;
using System.Collections.Generic; using System.Collections.Generic;

View File

@ -1,5 +1,6 @@
#if UNITY_EDITOR #if UNITY_EDITOR
using DCFApixels.DragonECS.Core; using DCFApixels.DragonECS.Core;
using DCFApixels.DragonECS.Core.Unchecked;
using DCFApixels.DragonECS.Unity.Internal; using DCFApixels.DragonECS.Unity.Internal;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -592,11 +593,11 @@ namespace DCFApixels.DragonECS.Unity.Editors
public static void EntityField(Rect position, DragonGUIContent label, EntitySlotInfo entity) public static void EntityField(Rect position, DragonGUIContent label, EntitySlotInfo entity)
{ {
bool isAlive = false; bool isAlive = false;
if (EcsWorld.TryGetWorld(entity.world, out EcsWorld world)) if (EcsWorld.TryGetWorld(entity.worldID, out EcsWorld world))
{ {
isAlive = world.IsAlive(entity.id, entity.gen); isAlive = world.IsAlive(entity.id, entity.gen);
} }
EntityField_Internal(position, label, entity.id == 0, isAlive ? EntityStatus.Alive : EntityStatus.NotAlive, entity.id, entity.gen, entity.world); EntityField_Internal(position, label, entity.id == 0, isAlive ? EntityStatus.Alive : EntityStatus.NotAlive, entity.id, entity.gen, entity.worldID);
} }
public static void EntityField(Rect position, SerializedProperty property) public static void EntityField(Rect position, SerializedProperty property)
{ {
@ -613,11 +614,11 @@ namespace DCFApixels.DragonECS.Unity.Editors
else else
{ {
bool isAlive = false; bool isAlive = false;
if (EcsWorld.TryGetWorld(entity.world, out EcsWorld world)) if (EcsWorld.TryGetWorld(entity.worldID, out EcsWorld world))
{ {
isAlive = world.IsAlive(entity.id, entity.gen); isAlive = world.IsAlive(entity.id, entity.gen);
} }
EntityField_Internal(position, label, entity.id == 0, isAlive ? EntityStatus.Alive : EntityStatus.NotAlive, entity.id, entity.gen, entity.world); EntityField_Internal(position, label, entity.id == 0, isAlive ? EntityStatus.Alive : EntityStatus.NotAlive, entity.id, entity.gen, entity.worldID);
} }
} }