Beispiel #1
0
 private void InitPollingOperation()
 {
     globalUnionPollingOperation = new PollingOperation();
     globalUnionPollingOperation.Init();
     globalUnionPollingOperation.SetName("GlobalUnion");
     globalUnionPollingOperation.SetOperationObjectSortFunc(UnitSort);
 }
Beispiel #2
0
    private BaseSystem CreateFunctionSystem(ECSDefine.SystemType systemType, int systemId)
    {
        ECSDefine.SystemFunctionType systemFunction;
        if (!ECSInstanceDefine.SystemType2Function.TryGetValue(systemType, out systemFunction))
        {
            Debug.LogError($"[ECSModule] CreateFunctionSystem Fail. No SystemFunctionType Reocrd. systemType:{Enum.GetName(typeof(ECSDefine.SystemType), systemType)}");
            return(null);
        }

        PollingOperation functionSystemOperation;

        if (!functionSystemOperationDict.TryGetValue(systemFunction, out functionSystemOperation))
        {
            functionSystemOperation = new PollingOperation();

            functionSystemOperation.Init();
            functionSystemOperation.SetName(Enum.GetName(typeof(ECSDefine.SystemFunctionType), systemFunction) + "System");

            functionSystemOperationDict.Add(systemFunction, functionSystemOperation);
        }

        OperationObject operationObject = functionSystemOperation.AddOperationObject((int)systemType, systemId);

        if (operationObject == null)
        {
            Debug.LogError($"[ECSModule] CreateSystem Fail. systemType:{Enum.GetName(typeof(ECSDefine.SystemType), systemType)}");
            return(null);
        }

        return(InitSystem(operationObject, systemType, systemId));
    }
Beispiel #3
0
    private void DeleteFunctionSystem(ECSDefine.SystemType systemType, BaseSystem system)
    {
        ECSDefine.SystemFunctionType systemFunction;
        if (!ECSInstanceDefine.SystemType2Function.TryGetValue(systemType, out systemFunction))
        {
            Debug.LogError($"[ECSModule] CreateFunctionSystem Fail. No SystemFunctionType Reocrd. systemType:{Enum.GetName(typeof(ECSDefine.SystemType), systemType)}");
            return;
        }

        PollingOperation functionSystemOperation;

        if (!functionSystemOperationDict.TryGetValue(systemFunction, out functionSystemOperation))
        {
            functionSystemOperation = new PollingOperation();

            functionSystemOperation.Init();
            functionSystemOperation.SetName(Enum.GetName(typeof(ECSDefine.SystemFunctionType), systemFunction) + "System");

            functionSystemOperationDict.Add(systemFunction, functionSystemOperation);
        }

        functionSystemOperation.RemoveOperationObject((int)systemType, system);
    }
Beispiel #4
0
 private void InitPollingOperation()
 {
     globalUnionPollingOperation = new PollingOperation();
     globalUnionPollingOperation.Init();
     globalUnionPollingOperation.SetName("RunSystem");
 }