示例#1
0
    void Update()
    {
        critter = uiControl.ViewSelectedCritter();

        if(critter){
            critterSprite = critter.GetTokenSprite();
            color = critter.GetTokenColor();
        }

        this.GetComponent<Image>().sprite = critterSprite;
        this.GetComponent<Image>().color = color;
    }
示例#2
0
    public void Activate(Critter newCritter)
    {
        gameObject.SetActive(true);

        if (!circle) {
            circle = GetComponentsInChildren<Image>()[0];
            icon = GetComponentsInChildren<Image>()[1];
            popText = GetComponentInChildren<Text>();
            habitat = GetComponentInParent<Hex>();
        }

        critter = newCritter;
        color = critter.GetTokenColor();
        critterSprite = critter.GetTokenSprite();

        UpdateIcon(critter);
    }
示例#3
0
    void Update()
    {
        if(critter == null){
            critter = player.GetCritter();

            if(critter == null){
                evoPts.text = "10";
                migrationTokens.text = "0";
            }
            else{
                tokenImg.sprite = critter.GetTokenSprite();
                tokenImg.color = critter.GetTokenColor();
            }
        }
        else
        {
            int totalPop;
            int evoTokens = critter.GetEvoPts();
            int migrateTokens = critter.GetMigrationTokens();

            if(evoTokens > 99){
                evoTokens = 99;
            }
            if(migrateTokens > 99){
                migrateTokens = 99;
            }

            evoPts.text = evoTokens.ToString();
            migrationTokens.text = migrateTokens.ToString();

            if (TurnTimer.currentTurn != currentTurn)
            {
                totalPop = (int)critter.GetTotalPopulation();
                population.text = NormalizePopTesxt(totalPop);
                currentTurn = TurnTimer.currentTurn;
            }

            tokenImg.sprite = critter.GetTokenSprite();
            tokenImg.color = critter.GetTokenColor();
        }
    }