示例#1
0
    public void ShowInfo(string powerUpId)
    {
        // search in database
        PowerupModel powerUp = FindPowerUp(powerUpId);

        Debug.Log(powerUpId + " = " + powerUp);
        if (powerUp != null)
        {
            Debug.Log(powerUp.Name);

            IconImage.sprite = powerUp.IconImage;
            InfoText.text    = powerUp.Name;
        }

        StartCoroutine(IEShowInfo(powerUpId));
    }
示例#2
0
    PowerupModel FindPowerUp(string powerUpId)
    {
        int i = 0;

        while (i < Powerups.Length)
        {
            PowerupModel currentPowerup = Powerups [i];
            if (currentPowerup.Id == powerUpId)
            {
                return(currentPowerup);
            }

            i++;
        }
        return(null);
    }