Beispiel #1
0
    public BaseEntity CreateEntity(ECSDefine.EntityType entityType, int entityId)
    {
        OperationObject operationObject = entityOperation.CreateOperationObject((int)entityType, entityId);

        if (operationObject == null)
        {
            Debug.LogError($"[ECSModule] CreateEntity Fail. componentType:{Enum.GetName(typeof(ECSDefine.EntityType), entityType)}");

            return(null);
        }

        BaseEntity entity = operationObject as BaseEntity;

        entity.SetGlobalUnionId(GlobalUnionId);

        entity.SetEntityId(entityId);
        entity.SetEntityType(entityType);

        return(entity);
    }
Beispiel #2
0
 public void SetEntityType(ECSDefine.EntityType entityType)
 {
     this.entityType = entityType;
 }
Beispiel #3
0
 public void DeleteEntity(BaseEntity entity)
 {
     ECSDefine.EntityType entityType = entity.GetEntityType();
     entityOperation.DeleteOperationObject((int)entityType, entity);
 }