// ---------------------------------------------------------------- // Initialize // ---------------------------------------------------------------- public void Initialize(BoardView _boardView, BoardSpace mySpace) { this.myBoardView = _boardView; int col = mySpace.Col; int row = mySpace.Row; // Parent me to my boooard! GameUtils.ParentAndReset(this.gameObject, _boardView.tf_boardSpaces); this.gameObject.name = "BoardSpace_" + col + "," + row; // Size/position me right! float diameter = _boardView.UnitSize - 1; myRectTransform.anchoredPosition = new Vector2(_boardView.BoardToX(col), _boardView.BoardToY(row)); myRectTransform.sizeDelta = new Vector2(diameter, diameter); // Only show body if I'm playable. i_body.enabled = mySpace.IsPlayable; // Add walls! if (mySpace.IsWall(Sides.T)) { AddWallImage(Sides.T); } if (mySpace.IsWall(Sides.L)) { AddWallImage(Sides.L); } }