Beispiel #1
0
    /// <summary>
    /// OnBuyBonus event listener
    /// </summary>
    private void OnBuyBonus()
    {
        Player _player = PlayerObject.GetComponent <Player>();
        var    bonus   = Bonuses.ElementAt(0);

        if (bonus.IsHealths)
        {
            if (_player.Score >= bonus.Price)
            {
                _player.AddHealths(bonus);
                _player.Score -= bonus.Price;
            }
        }
    }