public BaseSystem.ComponentInfo PopSystemComponentInfo() { int systemComponentInfoId = systemComponentInfoIdDistributionChunk.Pop(); OperationObject operationObject = systemComponentInfoOperation.CreateOperationObject((int)ECSDefine.SystemType.ComponentInfo, systemComponentInfoId); if (operationObject != null) { BaseSystem.ComponentInfo componentInfo = (BaseSystem.ComponentInfo)operationObject; return(componentInfo); } return(null); }
private List <BaseComponent> RequireComponentList(BaseEntity entity, List <BaseSystem.ComponentInfo> componentInfos) { List <BaseComponent> componentList = null; for (int index = 0; index < componentInfos.Count; index++) { BaseSystem.ComponentInfo componentInfo = componentInfos[index]; BaseComponent component = null; if (componentInfo.ComponentId != -1) { component = entity.GetComponentByComponentId(componentInfo.ComponentId); } else if (componentInfo.ComponentType != ECSDefine.ComponentType.Base) { component = entity.GetComponentByComponentType(componentInfo.ComponentType); } if (component == null) { componentList = null; Debug.LogError($"[ECSModule] ExecuteSystem Fail. Component Is nil. {entity.GetEntityId()} componentId:{componentInfo.ComponentId } componentType:{componentInfo.ComponentType}"); break; } else { component = executeSystemController.RequireComponentControl(component); if (componentList == null) { componentList = new List <BaseComponent>(); } componentList.Add(component); } } return(componentList); }
public void PushSystemComponentInfo(BaseSystem.ComponentInfo componentInfo) { systemComponentInfoOperation.DeleteOperationObject((int)ECSDefine.SystemType.ComponentInfo, componentInfo); }