Ejemplo n.º 1
0
    public void UpdateMutationPanelUI(TrophicLayersManager layerManager)
    {
        panelMutationSpirit.SetActive(isOpen);
        if (isOpen)
        {
            animatorMutationUI.SetBool("_IsSelectedA", false);
            animatorMutationUI.SetBool("_IsSelectedB", false);
            animatorMutationUI.SetBool("_IsSelectedC", false);
            animatorMutationUI.SetBool("_IsSelectedD", false);

            if (selectedToolbarMutationID == 0)
            {
                animatorMutationUI.SetBool("_IsSelectedA", true);
            }
            else if (selectedToolbarMutationID == 1)
            {
                animatorMutationUI.SetBool("_IsSelectedB", true);
            }
            else if (selectedToolbarMutationID == 2)
            {
                animatorMutationUI.SetBool("_IsSelectedC", true);
            }
            else
            {
                animatorMutationUI.SetBool("_IsSelectedD", true);
            }

            UpdateUI(layerManager);
        }
    }
Ejemplo n.º 2
0
    private string GetSpiritBrushSummary(TrophicLayersManager layerManager)
    {
        string str = "";

        switch (uiManagerRef.curActiveTool)
        {
        case ToolType.None:
            //buttonToolbarInspect.GetComponent<Image>().color = buttonDisabledColor;
            break;

        /*case ToolType.Watcher:
         * str = "This spirit reveals\nhidden information.";
         * str += "\n\n";
         * break;
         * case ToolType.Mutate:
         * //buttonToolbarMutate.GetComponent<Image>().color = buttonActiveColor;
         * break;*/
        case ToolType.Add:
            str = "This spirit creates stuff.\n\nAlt Effect: Removes stuff.";
            break;

        //case ToolType.Remove:
        //buttonToolbarRemove.GetComponent<Image>().color = buttonActiveColor;
        //buttonToolbarRemove.gameObject.transform.localScale = Vector3.one * 1.25f;
        //break;
        case ToolType.Stir:
            str = "This spirit pushes material around.\n\nAlt Effect: None";
            break;

        default:
            break;
        }

        return(str);
    }
Ejemplo n.º 3
0
    private void UpdateAlgaeUI(TrophicLayersManager layerManager)
    {
        textMutationParameters.text = "Metabolic Rate:\nEfficiency:";
        float deltaMetabolism = vegetationManager.algaeSlotGenomeMutations[selectedToolbarMutationID].metabolicRate -
                                vegetationManager.algaeSlotGenomeCurrent.metabolicRate;
        string strDeltaMetabolism = GetStringDelta(deltaMetabolism);
        float  deltaEfficiency    = vegetationManager.algaeSlotGenomeMutations[selectedToolbarMutationID].growthEfficiency -
                                    vegetationManager.algaeSlotGenomeCurrent.growthEfficiency;
        string strDeltaEfficiency = GetStringDelta(deltaEfficiency);

        textMutationPanelCur.text = (vegetationManager.algaeSlotGenomeCurrent.metabolicRate * 100f).ToString("F2") +
                                    "\n" + vegetationManager.algaeSlotGenomeCurrent.growthEfficiency.ToString("F2");//"44.38";
        textMutationPanelNew.text = (vegetationManager.algaeSlotGenomeMutations[selectedToolbarMutationID].metabolicRate * 100f).ToString("F2") +
                                    strDeltaMetabolism + "\n" +
                                    vegetationManager.algaeSlotGenomeMutations[selectedToolbarMutationID].growthEfficiency.ToString("F2") +
                                    strDeltaEfficiency;// "83.46";
        textCost.text      = "";
        textTopCenter.text = "";

        //Cur Mat
        mutationThumbnailDecomposersMatCur.SetVector("_TintPri", vegetationManager.algaeSlotGenomeCurrent.displayColorPri);
        mutationThumbnailDecomposersMatCur.SetVector("_TintSec", vegetationManager.algaeSlotGenomeCurrent.displayColorSec);
        mutationThumbnailDecomposersMatCur.SetInt("_PatternRow", vegetationManager.algaeSlotGenomeCurrent.patternRowID);
        mutationThumbnailDecomposersMatCur.SetInt("_PatternColumn", vegetationManager.algaeSlotGenomeCurrent.patternColumnID);
        mutationThumbnailDecomposersMatCur.SetFloat("_PatternThreshold", vegetationManager.algaeSlotGenomeCurrent.patternThreshold);
        // New:
        mutationThumbnailDecomposersMatNew.SetVector("_TintPri", vegetationManager.algaeSlotGenomeMutations[selectedToolbarMutationID].displayColorPri);
        mutationThumbnailDecomposersMatNew.SetVector("_TintSec", vegetationManager.algaeSlotGenomeMutations[selectedToolbarMutationID].displayColorSec);
        mutationThumbnailDecomposersMatNew.SetInt("_PatternRow", vegetationManager.algaeSlotGenomeMutations[selectedToolbarMutationID].patternRowID);
        mutationThumbnailDecomposersMatNew.SetInt("_PatternColumn", vegetationManager.algaeSlotGenomeMutations[selectedToolbarMutationID].patternColumnID);
        mutationThumbnailDecomposersMatNew.SetFloat("_PatternThreshold", vegetationManager.algaeSlotGenomeMutations[selectedToolbarMutationID].patternThreshold);
        // A;
        mutationThumbnailDecomposersMatA.SetVector("_TintPri", vegetationManager.algaeSlotGenomeMutations[0].displayColorPri);
        mutationThumbnailDecomposersMatA.SetVector("_TintSec", vegetationManager.algaeSlotGenomeMutations[0].displayColorSec);
        mutationThumbnailDecomposersMatA.SetInt("_PatternRow", vegetationManager.algaeSlotGenomeMutations[0].patternRowID);
        mutationThumbnailDecomposersMatA.SetInt("_PatternColumn", vegetationManager.algaeSlotGenomeMutations[0].patternColumnID);
        mutationThumbnailDecomposersMatA.SetFloat("_PatternThreshold", vegetationManager.algaeSlotGenomeMutations[0].patternThreshold);
        //B:
        mutationThumbnailDecomposersMatB.SetVector("_TintPri", vegetationManager.algaeSlotGenomeMutations[1].displayColorPri);
        mutationThumbnailDecomposersMatB.SetVector("_TintSec", vegetationManager.algaeSlotGenomeMutations[1].displayColorSec);
        mutationThumbnailDecomposersMatB.SetInt("_PatternRow", vegetationManager.algaeSlotGenomeMutations[1].patternRowID);
        mutationThumbnailDecomposersMatB.SetInt("_PatternColumn", vegetationManager.algaeSlotGenomeMutations[1].patternColumnID);
        mutationThumbnailDecomposersMatB.SetFloat("_PatternThreshold", vegetationManager.algaeSlotGenomeMutations[1].patternThreshold);
        //C;
        mutationThumbnailDecomposersMatC.SetVector("_TintPri", vegetationManager.algaeSlotGenomeMutations[2].displayColorPri);
        mutationThumbnailDecomposersMatC.SetVector("_TintSec", vegetationManager.algaeSlotGenomeMutations[2].displayColorSec);
        mutationThumbnailDecomposersMatC.SetInt("_PatternRow", vegetationManager.algaeSlotGenomeMutations[2].patternRowID);
        mutationThumbnailDecomposersMatC.SetInt("_PatternColumn", vegetationManager.algaeSlotGenomeMutations[2].patternColumnID);
        mutationThumbnailDecomposersMatC.SetFloat("_PatternThreshold", vegetationManager.algaeSlotGenomeMutations[2].patternThreshold);
        //D:
        mutationThumbnailDecomposersMatD.SetVector("_TintPri", vegetationManager.algaeSlotGenomeMutations[3].displayColorPri);
        mutationThumbnailDecomposersMatD.SetVector("_TintSec", vegetationManager.algaeSlotGenomeMutations[3].displayColorSec);
        mutationThumbnailDecomposersMatD.SetInt("_PatternRow", vegetationManager.algaeSlotGenomeMutations[3].patternRowID);
        mutationThumbnailDecomposersMatD.SetInt("_PatternColumn", vegetationManager.algaeSlotGenomeMutations[3].patternColumnID);
        mutationThumbnailDecomposersMatD.SetFloat("_PatternThreshold", vegetationManager.algaeSlotGenomeMutations[3].patternThreshold);
    }
Ejemplo n.º 4
0
    public void Tick(TrophicLayersManager trophicLayersManager, VegetationManager veggieManager)
    {
        float nutrientsProduced            = 0f;
        float decomposersTotalProductivity = 0f;

        if (trophicLayersManager.IsLayerOn(KnowledgeMapId.Decomposers))
        {
            float decomposersOxygenMask   = Mathf.Clamp01(curGlobalOxygen * settings.environmentSettings._DecomposersOxygenMask);
            float decomposersDetritusMask = Mathf.Clamp01(curGlobalDetritus * settings.environmentSettings._DecomposersDetritusMask);
            decomposersTotalProductivity = curGlobalDecomposers * settings.environmentSettings._BaseDecompositionRate * decomposersOxygenMask * decomposersDetritusMask;

            detritusRemovedByDecomposersLastFrame = decomposersTotalProductivity;
            curGlobalDetritus -= decomposersTotalProductivity;

            nutrientsProduced = decomposersTotalProductivity * settings.environmentSettings._DetritusToNutrientsEfficiency;
            nutrientsProducedByDecomposersLastFrame = nutrientsProduced;
        }

        // waste from algaeReservoir???
        //curGlobalDetritus += wasteProducedByAlgaeReservoirLastFrame;
        curGlobalDetritus += wasteProducedByAnimalParticlesLastFrame;   // will have to add these inputs into the resourceGrid sim texture
        curGlobalDetritus += wasteProducedByPlantParticlesLastFrame;
        curGlobalDetritus += wasteProducedByAgentsLastFrame;
        curGlobalDetritus  = Mathf.Max(0f, curGlobalDetritus); // cap at 0f
        curGlobalDetritus  = Mathf.Min(curGlobalDetritus, 1000f);

        curGlobalNutrients += nutrientsProduced;
        //curGlobalNutrients -= algaeReservoirGrowth;
        curGlobalNutrients -= nutrientsUsedByPlantParticlesLastFrame;
        curGlobalNutrients  = Mathf.Max(0f, curGlobalNutrients); // cap at 0f
        curGlobalNutrients  = Mathf.Min(curGlobalNutrients, 1000f);

        // ***** TEMP!!!!!
        curGlobalNutrients      = veggieManager.curGlobalNutrientGridValues.x;
        curGlobalDetritus       = veggieManager.curGlobalNutrientGridValues.y + wasteProducedByAgentsLastFrame + wasteProducedByAnimalParticlesLastFrame;
        curGlobalDecomposers    = veggieManager.curGlobalNutrientGridValues.z;
        curGlobalAlgaeReservoir = veggieManager.curGlobalNutrientGridValues.w;
        //oxygenUsedByAgentsLastFrame
        curTotalMass = curGlobalNutrients + curGlobalDetritus + curGlobalDecomposers + curGlobalAlgaeReservoir;
    }
Ejemplo n.º 5
0
    private void UpdateUI(TrophicLayersManager layerManager)
    {
        //textToolbarWingPanelName.text = "Mutations:";

        animatorMutationUI.SetBool("_IsOpen", isOpen);

        textMutationPanelOptionA.text = ""; // "Tiny";
        textMutationPanelOptionB.text = ""; // "Small";
        textMutationPanelOptionC.text = ""; // "Large";
        textMutationPanelOptionD.text = ""; // "Huge";

        textMutationPanelTitleCur.text = "CURRENT";
        string[] titlesTxt = new string[4];
        titlesTxt[0] = "TINY MUTATION";
        titlesTxt[1] = "SMALL MUTATION";
        titlesTxt[2] = "LARGE MUTATION";
        titlesTxt[3] = "HUGE MUTATION";
        textMutationPanelTitleNew.text = "MUTATION:";// titlesTxt[selectedToolbarMutationID];

        imageMutationPanelThumbnailA.gameObject.SetActive(true);
        imageMutationPanelThumbnailB.gameObject.SetActive(true);
        imageMutationPanelThumbnailC.gameObject.SetActive(true);
        imageMutationPanelThumbnailD.gameObject.SetActive(true);

        buttonToolbarMutateConfirm.gameObject.SetActive(selectedToolbarMutationID >= 0);

        TrophicSlot slotRef = uiManagerRef.worldSpiritHubUI.selectedWorldSpiritSlot;

        textMutationTargetLayer.text  = slotRef.speciesName;
        textMutationTargetLayer.color = uiManagerRef.worldSpiritHubUI.curIconColor;
        imageMutationCurTarget.color  = uiManagerRef.worldSpiritHubUI.curIconColor;
        imageMutationCurTarget.sprite = uiManagerRef.worldSpiritHubUI.curIconSprite;

        imageMutationVertebrateRender.gameObject.SetActive(false);
        //imageMutationCurTarget.gameObject.SetActive(true);
        imageMutationPanelCurPortrait.gameObject.SetActive(true);
        imageMutationPanelNewPortrait.gameObject.SetActive(true);

        if (slotRef.kingdomID == KingdomId.Decomposers)
        {
            UpdateDecomposerUI();
        }
        else if (slotRef.id == KnowledgeMapId.Algae)
        {
            UpdateAlgaeUI(layerManager);
        }
        else if (slotRef.id == KnowledgeMapId.Plants)
        {
            UpdatePlantsUI();
        }
        else if (slotRef.id == KnowledgeMapId.Microbes)
        {
            UpdateZooplanktonUI();
        }
        else if (slotRef.id == KnowledgeMapId.Animals)
        {
            imageMutationPanelThumbnailA.gameObject.SetActive(false);
            imageMutationPanelThumbnailB.gameObject.SetActive(false);
            imageMutationPanelThumbnailC.gameObject.SetActive(false);
            imageMutationPanelThumbnailD.gameObject.SetActive(false);
        }
        else if (slotRef.kingdomID == KingdomId.Terrain)
        {
            UpdateTerrainUI(slotRef);
        }
    }
Ejemplo n.º 6
0
 public void UpdateKnowledgePanelUI(TrophicLayersManager layerManager)
 {
     panelKnowledgeSpiritBase.SetActive(true);
     UpdateUI();
 }