Пример #1
0
    private void Start()
    {
        _confirmPanel.SetConfirmListener(_actionObjectSpawner.ConfirmSetObject, _spawnObjectSpawner.ConfirmSetObject, _confirmPanel.ToggleActiveButtons, _deletedPanel.ClosePanel);
        _confirmPanel.SetCancelListener(_actionObjectSpawner.EndUse, _spawnObjectSpawner.EndUse, _confirmPanel.ToggleActiveButtons, _deletedPanel.ClosePanel);
        _economy       = _actionObjectSpawner.GetComponent <GameEconomy>();
        _productPanels = GetComponentsInChildren <ProductPanel>();
        _actionObjectSpawner.DeletingObject  += _confirmPanel.ToggleActiveButtons;
        _actionObjectSpawner.DeletingObject  += _deletedPanel.OpenPanel;
        _actionObjectSpawner.OutOfAnchors    += OutOfAnchors;
        _actionObjectSpawner.AnchorsAppeared += ActionAnchorsAppeared;
        _spawnObjectSpawner.OutOfAnchors     += OutOfAnchors;
        _spawnObjectSpawner.UsedMaxUpgrade   += MaxSpawnUpgrade;

        foreach (var product in _productPanels)
        {
            product.AddListenerToButton(SendObjectToSpawner, ToggleActive, _confirmPanel.ToggleActiveButtons, ShowCommercial, _economy, _scorreForm);
        }
        _startButton.onClick.Invoke();
        ToggleActive();
    }