/// <summary> /// Called when this gem has been collected by a player and removed from the level. /// </summary> /// <param name="collectedBy"> /// The player who collected this gem. Although currently not used, this parameter would be /// useful for creating special powerup gems. For example, a gem could make the player invincible. /// </param> public void OnCollected(Player collectedBy) { switch (tipoGem) { case TipoGem.Normal: { collectedSound.Play(); break; } case TipoGem.PowerUp: { collectedBy.PowerUp(); break; } case TipoGem.Live: { collectedSound.Play(); collectedBy.LiveUp(); break; } case TipoGem.Dead: { collectedSound.Play(); collectedBy.Dead(); break; } case TipoGem.PowerDown: { collectedSound.Play(); collectedBy.PowerDown(); break; } default: break; } }