public void OnEvent(CustomEventArgs messageData) { var message = messageData.Message; switch (message) { case GameEventName.GoUseAutoReward: var tokensReward = messageData.Value as List <TokenRewardEnum>; ProcessAutoUseTokens(tokensReward); break; case GameEventName.GoSelectTokenReward: _currentToken = messageData.Value as IToken; Debug.Log(_currentToken.GetDataToken().Token); FindEmptyCell(); break; case GameEventName.GoAddTokenReward: _currentPlayer = (GameClass)messageData.Value; var token = _currentToken.GetDataToken().Token; var index = _dictionaryToken[_currentPlayer].IndexOf(TokenRewardEnum.Undefined); _dictionaryToken[_currentPlayer][index] = token; var art = _dictionaryIconToken[_currentPlayer][index].GetComponent <SpriteRenderer>(); art.sprite = _currentToken.GetDataToken().Art; _publisher.Publish(null, new CustomEventArgs(GameEventName.GoEndSelectTokenReward, _currentToken)); _currentToken = null; break; case GameEventName.GoRemoveTokenReward: break; case GameEventName.GoDeActivateTargetsPlayer: _currentToken = null; break; } }