예제 #1
0
    // * WPP: if possible, store RenderTextures in KnowledgeMapData fields
    RenderTexture GetRenderTexture(KnowledgeMapId id)
    {
        switch (id)
        {
        case KnowledgeMapId.Decomposers: return(simulationManager.vegetationManager.resourceGridRT1);

        case KnowledgeMapId.Algae: return(simulationManager.vegetationManager.resourceGridRT1);

        case KnowledgeMapId.Plants: return(fluidManager._SourceColorRT);

        case KnowledgeMapId.Microbes: return(fluidManager._SourceColorRT);

        case KnowledgeMapId.Animals: return(fluidManager._SourceColorRT);

        case KnowledgeMapId.World: return(theRenderKing.baronVonTerrain.terrainHeightDataRT);

        case KnowledgeMapId.Stone: return(theRenderKing.baronVonTerrain.terrainHeightDataRT);

        case KnowledgeMapId.Pebbles: return(theRenderKing.baronVonTerrain.terrainHeightDataRT);

        case KnowledgeMapId.Sand: return(theRenderKing.baronVonTerrain.terrainHeightDataRT);

        case KnowledgeMapId.Nutrients: return(simulationManager.vegetationManager.resourceGridRT1);

        case KnowledgeMapId.Water: return(theRenderKing.baronVonWater.waterSurfaceDataRT0);

        case KnowledgeMapId.Wind: return(theRenderKing.baronVonWater.waterSurfaceDataRT0);

        case KnowledgeMapId.Detritus: return(simulationManager.vegetationManager.resourceGridRT1);

        default: return(null);
        }
    }
예제 #2
0
파일: Lookup.cs 프로젝트: eaclou/Evolution
    // TBD: cache specific elements for faster lookup
    public TrophicLayerSO GetTrophicSlotData(KnowledgeMapId id)
    {
        foreach (var map in knowledgeMaps)
        {
            if (map.id == id)
            {
                return(map);
            }
        }

        Debug.LogError("Invalid map state " + id);
        return(knowledgeMaps[0]);
    }
예제 #3
0
    public TrophicSlot GetSlot(KnowledgeMapId id)
    {
        foreach (var slot in allTrophicSlots)
        {
            if (slot.data.id == id)
            {
                return(slot);
            }
        }

        Debug.LogError("Invalid slot " + id);
        return(null);
    }
예제 #4
0
    int TimeStepLayerOn(KnowledgeMapId layer)
    {
        switch (layer)
        {
        case KnowledgeMapId.Microbes: return(timeStepZooplanktonOn);

        case KnowledgeMapId.Plants: return(timeStepPlantsOn);

        case KnowledgeMapId.Algae: return(timeStepAlgaeOn);

        case KnowledgeMapId.Decomposers: return(timeStepDecomposersOn);

        default: return(0);
        }
    }
예제 #5
0
    public bool IsLayerOn(KnowledgeMapId layer)
    {
        switch (layer)
        {
        case KnowledgeMapId.Decomposers: return(decomposersOn);

        case KnowledgeMapId.Algae: return(algaeOn);

        case KnowledgeMapId.Plants: return(plantsOn);

        case KnowledgeMapId.Microbes: return(zooplanktonOn);

        case KnowledgeMapId.Animals: return(agentsOn);

        default: return(false);
        }
    }
예제 #6
0
 public void SetFollowing(KnowledgeMapId id)
 {
     isFollowingAgent          = id == KnowledgeMapId.Animals;
     isFollowingPlantParticle  = id == KnowledgeMapId.Plants;
     isFollowingAnimalParticle = id == KnowledgeMapId.Microbes;
 }
예제 #7
0
 public void SetSlot(KnowledgeMapId id)
 {
     SetSlot(lookup.GetTrophicSlotData(id));
 }
예제 #8
0
 public float GetLayerLerp(KnowledgeMapId layer, int timeStep)
 {
     return(IsLayerOn(layer) ?
            Mathf.Clamp01((float)(timeStep - TimeStepLayerOn(layer)) / (float)timeStepsLayerGrowthDuration) :
            0f);
 }
예제 #9
0
 public void SetSlotStatus(KnowledgeMapId id, TrophicSlotStatus value)
 {
     GetSlot(id).status = value;
 }