Exemplo n.º 1
0
 public void ExecuteCacheSynchroValueRep()
 {
     for (int index = 0; index < synchroValueRepList.Count; index++)
     {
         SynchroValueRep synchroValueRep = synchroValueRepList[index];
         SynchroValueRsp synchroValueRsp = SynchroValueRepToSynchroValueRsp(synchroValueRep);
         if (synchroValueRsp == null)
         {
             continue;
         }
         sendSynchroValueRspList.Add(synchroValueRsp);
     }
     synchroValueRepList.Clear();
 }
Exemplo n.º 2
0
    public void ExecuteCacheSynchroValueRsp()
    {
        for (int index = 0; index < synchroValueRspList.Count; index++)
        {
            SynchroValueRsp synchroValueRsp = synchroValueRspList[index];

            ECSDefine.ComponentType             componentType = synchroValueRsp.GetComponentType();
            ECSDefine.SynchroValueRspSystemType synchroValueRspSystemType;
            if (!ECSInstanceDefine.RequireComponentType2ExecuteSystem.TryGetValue(componentType, out synchroValueRspSystemType))
            {
                Debug.LogError($"[SynchronizationUnit] ExecuteCacheSynchroValueRsp Fail. {Enum.GetName(typeof(ECSDefine.ComponentType), componentType)}");
                continue;
            }
            SynchroValueRsp.SynchroValueRspStructure synchroValueRspStructure = synchroValueRsp.GetSynchroValueRspStructure();
            executeSystemUnit.ExecuteSynchroValueRspSystem(synchroValueRspSystemType, synchroValueRspStructure);
        }
        synchroValueRspList.Clear();
    }
Exemplo n.º 3
0
    private SynchroValueRsp SynchroValueRepToSynchroValueRsp(SynchroValueRep synchroValueRep)
    {
        int             synchroValueRepId = synchroValueRep.GetSynchroValueRepId();
        int             synchroValueRspId = synchroValueRepId + 1;
        OperationObject operationObject   = SynchroValueRspOperation.CreateOperationObject((int)ECSDefine.SynchronizationValueType.Response, synchroValueRspId);

        if (operationObject == null)
        {
            Debug.LogError("[SynchronizationUnit] SynchroValueRepToSynchroValueRsp Fail. Create SynchroValueRsp Fail");
            return(null);
        }

        int entityId    = synchroValueRep.GetEntityId();
        int componentId = synchroValueRep.GetComponentId();

        ECSDefine.ComponentType componentType = synchroValueRep.GetComponentType();

        SynchroValueRsp synchroValueRsp = operationObject as SynchroValueRsp;

        synchroValueRsp.SetSynchroValueRspId(synchroValueRspId);
        synchroValueRsp.SetComponentId(componentId);
        synchroValueRsp.SetComponentType(componentType);
        synchroValueRep.SetEntityId(entityId);

        BaseEntity entity = ecsUnit.GetEntity(entityId);

        if (entity == null)
        {
            synchroValueRsp.SetIsEntityAlive(true);
            BaseComponent component = entity.GetComponentByComponentId(componentId);
            synchroValueRsp.SetIsComponentAlive(component != null);
        }
        else
        {
            synchroValueRsp.SetIsEntityAlive(false);
            synchroValueRsp.SetIsComponentAlive(false);
        }

        return(synchroValueRsp);
    }
Exemplo n.º 4
0
 public void ReceiveSynchroValueRsp(SynchroValueRsp synchroValueRsp)
 {
     synchroValueRspList.Add(synchroValueRsp);
 }
 public void ReceiveSynchroValueRsp(SynchroValueRsp synchroValueRsp)
 {
     receiveSynchroValueRsp.Add(synchroValueRsp);
 }