public MoveSelection getSelectedMove() { MoveSelection result = selectedMove; selectedMove = null; return result; }
public void selectMove(Move move) { if (selectedMove == null) { selectedMove = new MoveSelection(move, Time.time); Debug.Log ("selected : " + move); } }
public void Setup() { _cellsProviderMocker = new MoveSelectionCellProviderMocker(); _cellsProviderMocker.SetupGet(new BoardCellComponentBuilder().Build()); _cellsProviderMocker.SetupContainsPlayerPiece(true); _moveSelection = new MoveSelection(_cellsProviderMocker.Instance()); }
public void selectMove (Move move) { if (selectedMove == null) { selectedMove = new MoveSelection(move, Time.time); //Debug.Log ("selected : " + move); if(selectedMove.move == Move.ROCK){playercurrentmove.gameObject.GetComponent<SpriteRenderer>().sprite=rockSprite;} if(selectedMove.move == Move.PAPER){playercurrentmove.gameObject.GetComponent<SpriteRenderer>().sprite=paperSprite;} if(selectedMove.move == Move.SCISSOR){playercurrentmove.gameObject.GetComponent<SpriteRenderer>().sprite=scissorSprite;} } }
public override void MouseUp(ViewportBase viewport, ViewportEvent e) { base.MouseUp(viewport, e); if (_currentTool == null) { return; } _currentTool.MouseUp(viewport, e); if (!(viewport is Viewport2D)) { return; } if (_currentTool.NoSelection()) { return; } if (!e.Handled) { if (MoveSelection != null && !KeyboardState.Ctrl) { // If we were clicking on a point, and the mouse hasn't moved yet, // and ctrl is not down, deselect the other points. Points.ForEach(x => x.IsSelected = false); MoveSelection.ForEach(x => x.IsSelected = true); VertexSelectionChanged(); _currentTool.MouseClick(viewport, e); } else { _currentTool.DragEnd(); } } RefreshMidpoints(); _snapPointOffset = null; _movingPoint = null; MoveSelection = null; }