Best way to store and use small game data?

Hi,
I have a game that allows me to place rooks on a chess board by clicking on the game squares. I would like to change my game so that I can place either rooks or pawns. I made some UI buttons called “rook” and “pawn”. I would like it that when I click the rook button, my game remembers it, and then the after that it places rooks on the board until such as time as when I click the pawn button. Then the game will place pawns etc.
My question though, is what is the best way to store this information? Here is some code I wrote, as sort of an experiment:

using UnityEngine;
using System.Collections;
public class GameScript : MonoBehaviour {
    private int piece = 0;
    public int getPiece()
    {
        return piece;
    }
}  

The code that places the chess pieces (and therefor needs the information of which piece to place):

using UnityEngine;
using System.Collections;

public class PlaceChessPieces : MonoBehaviour {
    public GameObject piece;
    private GameScript data;

	void Start () {
        Debug.Log("A instance of PlaceChessPieces was initialized");
        piece = Resources.Load("rookPiecePrefab") as GameObject;
        GameScript data = new GameScript();
    }
    void OnMouseDown()
    {

        if(data.getPiece() == 0)
        {
            Instantiate(piece, transform.position + new Vector3(0, 0.5f, 0), Quaternion.Euler(-90, 0, 0));
        }
        //Instantiate(piece, transform.position + new Vector3(0,0.5f,0), Quaternion.Euler(-90, 0, 0));
    }
}

First of all, you should look at the manual for the usage of a “Button”.

http://docs.unity3d.com/Manual/script-Button.html
https://unity3d.com/learn/tutorials/modules/beginner/ui/ui-button

Once you have digested the information on how to do this the easy way in the editor you can take a look at the scripted method :

http://docs.unity3d.com/ScriptReference/UI.Selectable.OnPointerDown.html

The UI works together with the EventSystem (and input modules) to generate these events and will populate the PointerEventData with the relevant information. If you look at the PED link you will see it has a whole wealth of very useful information including positions and objects pressed. The data even includes a raycast from the Graphics Raycaster (attached to the canvas).

The OnPointerDown link above demonstrates how to set up the Interface. What is doesn’t mention is how to use the data.

public void OnPointerDown (PointerEventData eventData) 
{
	Debug.Log (eventData.pointerPress.name);
    //pointerPress ->	The GameObject that received the OnPointerDown.
}

I’ve simply changed the example in the docs to show the name of the last pressed object generated in the Pointer Event Data.