Exemple #1
0
 public void Activate(IBonus bonus)
 {
     _bonus = bonus;
     GameController.BonusTypes bonusType = bonus.GetBonusType();
     _currentBonusImage.sprite = _bonusSprites[(int) bonusType];
     _textField.text = _bonus.GetTTL().ToString();
     _group.alpha = 1;
 }
Exemple #2
0
 public void Activate(IBonus bonus)
 {
     _bonus = bonus;
     GameController.BonusTypes bonusType = bonus.GetBonusType();
     _currentBonusImage.sprite = _bonusSprites[(int)bonusType];
     _textField.text           = _bonus.GetTTL().ToString();
     _group.alpha = 1;
 }
Exemple #3
0
    public void OnMouseDown()
    {
        if (_megaBonus == null)
        {
            return;
        }
        _client.UseBonus(_megaBonus.GetBonusType().ToString(), (JSONObject result) => {
            Debug.Log(result.ToString());
            //TODO: uncomment when shop will be implemented

            /*if(!result.HasField ("error")) {
             *      GameObject icon = Instantiate(_megaIconPrefab);
             *      MegaBonusIcon iconObject = icon.GetComponent<MegaBonusIcon>();
             *      iconObject.SetBonus(_megaBonus, _image.sprite);
             *      _megaBonusButton.gameObject.SetActive(false);
             * }*/
        });
        GameObject    icon       = Instantiate(_megaIconPrefab);
        MegaBonusIcon iconObject = icon.GetComponent <MegaBonusIcon>();

        iconObject.SetBonus(_megaBonus, _image.sprite);
        _megaBonusButton.gameObject.SetActive(false);
    }
Exemple #4
0
 public void SetMegaBonus(IBonus megaBonus)
 {
     _megaBonus = megaBonus;
     _image.sprite = _bonusSprites[(int) megaBonus.GetBonusType()];
 }
Exemple #5
0
 public void SetMegaBonus(IBonus megaBonus)
 {
     _megaBonus    = megaBonus;
     _image.sprite = _bonusSprites[(int)megaBonus.GetBonusType()];
 }