예제 #1
0
    public void Activate(Adaptation evo, Adaptation.BodySlot newType)
    {
        Initialize();

        evoButton = evo.GetEvoButton().GetComponent<AdaptationButton>();

        Icon.sprite = evo.GetIcon();
        Icon.color = new Color32(255, 255, 255, 255);

        Background.color = evoButton.GetHexColor();
    }
예제 #2
0
    public void PopulateInfo(Adaptation evo)
    {
        if(!SimpleInfo){
            selectedEvo = evo;

            bobbleCounter.ActivateBobbles(evo.cost);
        }

        ClearEffectsPanel();

        if (evo != null){
            elements[0].text = evo.name;
            icon.sprite = evo.GetIcon();
            icon.color = new Color32(255, 255, 255, 255);

            PopulateEffects(evo);

            if (!SimpleInfo)
            {
                statPanel.SetCritterStats();

                elements[1].text = evo.description;
                UpdateBuyButton();

                statPanel.SetCritterStats();

                if (evo.isMajor)
                {
                    //evo is major and equipped.
                    if (evo.GetCurrentBuyState() == Adaptation.playerBuyState.EQUIPED)
                    {
                        VisualizeSellChanges(evo);
                    }
                    //Evo is major and is replacing an equipped evo.
                    else
                    {
                        if (TraitsPanel.GetSelectedSlot())
                        {
                            if (TraitsPanel.GetSelectedSlot().GetActiveEvo() != null)
                            {
                                Adaptation slotEvo = TraitsPanel.GetSelectedSlot().GetActiveEvo();

                                VisualizeSellChanges(slotEvo);
                                VisualizeBuyChanges(evo);
                            }
                            //no evo is equipped to an empty slot.
                            else
                            {
                                VisualizeBuyChanges(evo);
                            }
                        }
                    }
                }

                else
                {
                    //evo is minor and active.
                    if (evo.GetCurrentBuyState() == Adaptation.playerBuyState.ACTIVE)
                    {
                        VisualizeSellChanges(evo);
                    }
                    //evo is minor and not active.
                    else
                    {
                        VisualizeBuyChanges(evo);
                    }
                }
            }
        }

        else {
            gameObject.SetActive(false);
        }
    }