//NOT USED
    void DropToBoard()
    {
        Vector2 snapPos = hexController.FindNearest((Vector2)this.transform.position);

        this.transform.position = snapPos;                                   //Snap to x,y position first
        this.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 0f)); //Snap to default rotation

        currentHex = hexController.GetNearestHex(this.transform.position);   //Set currentHex
        hexController.ClearHighlights();
        this.transform.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionY;
    }
Esempio n. 2
0
    public void UndoMove()
    {
        Debug.Log("UndoMove");

        selectionMode = true;

        boardManager.UndoLastMove();
        DisableButtons();                   //Don't allow buttons to be pressed until a valid move has been made
        boardManager.lastPieceMoved = null; //Clear the last piece moved variable
        hexController.ClearHighlights();    //Clear all highlights
    }