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; }
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; }
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); }
public void SetMegaBonus(IBonus megaBonus) { _megaBonus = megaBonus; _image.sprite = _bonusSprites[(int) megaBonus.GetBonusType()]; }
public void SetMegaBonus(IBonus megaBonus) { _megaBonus = megaBonus; _image.sprite = _bonusSprites[(int)megaBonus.GetBonusType()]; }