Exemplo n.º 1
0
 public void Dispose()
 {
     _observer.Dispose();
     if (_clearOnDispose)
     {
         _gridCellHighlighter.ClearHighlight();
     }
 }
Exemplo n.º 2
0
        private async void HandleAddUnitsPressed()
        {
            using (_inputLock.Lock()) {
                Show();
                ShowCancelButton();

                CancellableTaskResult <IntVector2> cancelableResult;
                using (_gridCellHighlighter.HighlightCellOnMouseOver(stayHighlighted: true)) {
                    cancelableResult =
                        await _gridInputManager.LeftMouseButtonOnTile.ToButtonCancellableTask(_cancelButton);
                }

                if (!cancelableResult.isCanceled)
                {
                    await _unitSpawnViewController.Show(cancelableResult.result, CancellationToken.None);
                }

                _gridCellHighlighter.ClearHighlight();
                ShowToolbar();
            }
        }