void Awake()
    {
        //accesses the location of white pieces
        whitePieces = GameObject.Find("White Pieces").GetComponent<whitePieceTracker>();

        //accesses the location of black pieces
        blackPieces = GameObject.Find("Black Pieces").GetComponent<blackPieceTracker>();

        //accesses the tiles
        boardTiles = GameObject.Find("BoardCreator").GetComponent<boardCreationScript>();
        tileMover = GameObject.Find("BoardCreator").GetComponent<alphaMovementScript>();

        //accesses the current turn
        turn = GameObject.Find("Piece Parent").GetComponent<turnTracker>();

        //turns off the piece's halo
        (gameObject.GetComponent("Halo") as Behaviour).enabled = false;

        //saves the pawn's original position
        homePosX = gameObject.transform.position.x;
        homePosY = gameObject.transform.position.y;

        //accesses piece's location
        coordinates = gameObject.GetComponent<positionScript>();

        myKing = GameObject.Find("Black King").GetComponent<kingMovement>();
        pieceColor = gameObject.transform.tag;
        gameObject.GetComponent<positionScript>().pieceColor = pieceColor;
        gameObject.GetComponent<positionScript>().pieceTag = pieceTag;
        coordinates.xHome = homePosX;
        coordinates.yHome = homePosY;
    }
    void Awake()
    {
        //stores piece's color
        pieceColor = gameObject.transform.tag;
        if (pieceColor == "Black") {
            myKing = GameObject.Find("Black King").GetComponent<kingMovement>();
        } else if (pieceColor == "White") {
            myKing = GameObject.Find("White King").GetComponent<kingMovement>();
        }

        //turns off the piece's halo
        (gameObject.GetComponent("Halo") as Behaviour).enabled = false;

        //accesses the location of white pieces
        whitePieces = GameObject.Find("White Pieces").GetComponent<whitePieceTracker>();

        //accesses the location of black pieces
        blackPieces = GameObject.Find("Black Pieces").GetComponent<blackPieceTracker>();

        //accesses the tiles
        boardTiles = GameObject.Find("BoardCreator").GetComponent<boardCreationScript>();
        tileMover = GameObject.Find("BoardCreator").GetComponent<alphaMovementScript>();

        //accesses the current turn
        turn = GameObject.Find("Piece Parent").GetComponent<turnTracker>();

        //accesses piece's location
        homePosX = gameObject.transform.position.x;
        homePosY = gameObject.transform.position.y;
        gameObject.GetComponent<positionScript>().xHome = homePosX;
        gameObject.GetComponent<positionScript>().yHome = homePosY;
        coordinates = gameObject.GetComponent<positionScript>();

        //creates the move and attack square arrays
        attackSquares = new GameObject[maxMoveSquares];
        diagMoveSquaresUpLeft = new GameObject[maxMoveSquares];
        diagMoveSquaresUpRight = new GameObject[maxMoveSquares];
        diagMoveSquaresDownLeft = new GameObject[maxMoveSquares];
        diagMoveSquaresDownRight = new GameObject[maxMoveSquares];
        attackSquaresColor = new Color[maxMoveSquares];

        gameObject.GetComponent<positionScript>().pieceColor = pieceColor;
        gameObject.GetComponent<positionScript>().pieceTag = pieceTag;
    }
    // Use this for initialization
    void Awake()
    {
        pieceColor = gameObject.transform.tag;
        if (pieceColor == "Black") {
            myKing = GameObject.Find("Black King").GetComponent<kingMovement>();
        } else if (pieceColor == "White") {
            myKing = GameObject.Find("White King").GetComponent<kingMovement>();
        }
        //turns off the piece's halo
        (gameObject.GetComponent("Halo") as Behaviour).enabled = false;

        //accesses the location of white pieces
        whitePieces = GameObject.Find("White Pieces").GetComponent<whitePieceTracker>();

        //accesses the location of black pieces
        blackPieces = GameObject.Find("Black Pieces").GetComponent<blackPieceTracker>();

        //accesses the tiles
        boardTiles = GameObject.Find("BoardCreator").GetComponent<boardCreationScript>();
        tileMover = GameObject.Find("BoardCreator").GetComponent<alphaMovementScript>();

        //accesses the current turn
        turn = GameObject.Find("Piece Parent").GetComponent<turnTracker>();

        //saves the pawn's original position and accesses its current one
        homePosX = gameObject.transform.position.x;
        homePosY = gameObject.transform.position.y;
        coordinates = gameObject.GetComponent<positionScript>();

        //creates the arrays for moveSquares
        vertMoveSquaresUp = new GameObject[maxMoveSquares];
        vertMoveSquaresDown = new GameObject[maxMoveSquares];
        horMoveSquaresLeft = new GameObject[maxMoveSquares];
        horMoveSquaresRight = new GameObject[maxMoveSquares];
        attackSquares = new GameObject[maxAttackSquares];
        attackSquaresColor = new Color[maxAttackSquares];

        gameObject.GetComponent<positionScript>().pieceColor = pieceColor;
        gameObject.GetComponent<positionScript>().pieceTag = pieceTag;
    }