This commit is contained in:
CortexCore
2025-03-24 14:42:40 +08:00
parent 18239a5ae4
commit 9845d20f7f
99 changed files with 5418 additions and 5512 deletions

View File

@@ -13,6 +13,7 @@ namespace BITKit.Entities
[DefaultExecutionOrder(-1)]
public class UnityEntity : MonoBehaviour,IEntity
{
[SerializeField] private bool debug;
private IEntitiesService _entitiesService;
private IEntity _entity;
@@ -22,6 +23,11 @@ namespace BITKit.Entities
if (_entitiesService.Entities.ContainsKey(gameObject.GetInstanceID())) return;
if (debug)
{
}
var entity = new Entity()
{
Id = gameObject.GetInstanceID(),
@@ -38,7 +44,10 @@ namespace BITKit.Entities
foreach (var component in GetComponents<Component>())
{
if(!component)continue;
var type = component.GetType();
entity.ServiceCollection.AddSingleton(type, component);
foreach (var x in type.GetInterfaces())
{