Esempio n. 1
0
 public override Task Show()
 {
     foreach (var element in _elementsDataBase.Elements)
     {
         var presenter   = GameObject.Instantiate(_editorContentPresenterPrefab, _presenterParent);
         var elementData = element;
         presenter.Init(element, () =>
         {
             OnClickElement?.Invoke(elementData, false);
             _canvasGroup.alpha = 0;
         }, () =>
         {
             OnClickElement?.Invoke(elementData, true);
             _canvasGroup.alpha = 0;
         });
     }
     return(base.Show());
 }
Esempio n. 2
0
 public override void HandleArguments(PlayWindowParams param)
 {
     _availableElements = param.AvailableElements;
     foreach (var element in _availableElements)
     {
         var presenter   = GameObject.Instantiate(_playerContentPresenterPrefab, _presenterParent);
         var elementData = element;
         presenter.SetCount(element.Count);
         presenter.Init(element.Element, () =>
         {
             if (presenter.CountLeft > 0 && !_playMode)
             {
                 presenter.DecrementCount();
                 OnClickElement?.Invoke(elementData.Element);
                 _canvasGroup.alpha = 0;
             }
         });
         _presenters[elementData.Element.ElementDisplayName] = presenter;
     }
 }