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)); }
PowerupModel FindPowerUp(string powerUpId) { int i = 0; while (i < Powerups.Length) { PowerupModel currentPowerup = Powerups [i]; if (currentPowerup.Id == powerUpId) { return(currentPowerup); } i++; } return(null); }