Пример #1
0
        protected void ClickTile(BoardCell cell, int index)
        {
            if (!GameManager.IsGameFinished)
            {
                GameManager.ExecuteMove(cell, index);
            }

            OnTileClicked.Invoke(index);
        }
Пример #2
0
    void ReadInput()
    {
        Tile currentMouseoverTile = _world.GetTile(GetCurrentMouseWorldPos());

        if (currentMouseoverTile != null)
        {
            if (currentMouseoverTile != _previousMouseoverTile)
            {
                OnTileHovered?.Invoke(currentMouseoverTile);
            }

            // Check what (if any) Tile was clicked
            if (Input.GetMouseButtonDown(0))
            {
                OnTileClicked?.Invoke(currentMouseoverTile);
            }
        }

        _previousMouseoverTile = currentMouseoverTile;
    }
Пример #3
0
 public void OnClicked()
 {
     OnTileClicked?.Invoke(TileID);
 }
Пример #4
0
 public void TileClick()
 {
     OnTileClicked?.Invoke(this);
 }
Пример #5
0
 public void TileClicked(TileController clickedTile)
 {
     OnTileClicked?.Invoke(clickedTile);
 }
Пример #6
0
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);

            OnTileClicked?.Invoke(this);
        }
Пример #7
0
 private void TileCanvas_MouseClick(object sender, MouseEventArgs e)
 {
     IsClicked = true;
     OnTileClicked.Invoke(this, this);
 }