コード例 #1
0
        private void OnMouseDown()
        {
            if (_cellSelectorRenderer == null)
            {
                return;
            }

            var mouseWorldPosition = MUtils.Mouse.GetWorldPosition(_mainCamera);

            ShipCellState state         = _grid.GetValueAt(mouseWorldPosition);
            var           localPosition = _grid.SnapToWorldGridPosition(mouseWorldPosition);

            OnGridLocationClicked?.Invoke(localPosition, state);
        }
コード例 #2
0
        private void ControllerOnOnGridLocationClicked(Vector2 position, ShipCellState obj)
        {
            battleManager.Player.FireAtTarget(position);

            this.EndPlayerTurn();
        }