1
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
Reference in New Issue
Block a user