public virtual void AddListenerToButton(Action <IGeneratedBy> listener, UnityAction closePanel, UnityAction openConfirmPanel, Action <string> showCommercial, GameEconomy economy, ScoreFormConverter scorreForm) { _scorreForm = scorreForm; _chooseProduct += listener; if (_product.IsOpeningObject && !_isPossibleToUse) { _actionsForOpenedPanels = new UnityAction[2]; _actionsForOpenedPanels[0] = closePanel; _actionsForOpenedPanels[1] = openConfirmPanel; _showCommercial += showCommercial; _productButton.onClick.AddListener(OnShowCommercial); _nameViewer.text = _product.OpeningObjectText.ToUpper(); } else { _productButton.onClick.AddListener(closePanel); _productButton.onClick.AddListener(openConfirmPanel); } _economy = economy; _economy.PurchaseCompleted += ChangePrice; ChangePrice(); }
public override void AddListenerToButton(Action <IGeneratedBy> listener, UnityAction closePanel, UnityAction openConfirmPanel, Action <string> showCommercial, GameEconomy economy, ScoreFormConverter scorreForm) { _economy = economy; _economy.PurchaseCompleted += ChangePrice; _scorreForm = scorreForm; ChangePrice(); }