Ejemplo n.º 1
0
    // Use the grid spacing to calculate the touch radius for each dot
    void CalculateTouchRadius()
    {
        float xSpacing = boardCoordinateSpace.XSpacing();
        float ySpacing = boardCoordinateSpace.YSpacing();

        DotTouchDistance = Mathf.Min(xSpacing, ySpacing) * .5f;
    }
Ejemplo n.º 2
0
    // Place the board space in the correct grid position
    void CalculateScreenPosition()
    {
        float xSpacing = coordinateSpace.XSpacing();
        float ySpacing = coordinateSpace.YSpacing();
        float xOffset  = xSpacing * boardIndex.x;
        float yOffset  = ySpacing * boardIndex.y;
        float xPos     = coordinateSpace.MinX() + xOffset + (xSpacing * .5f);
        float yPos     = coordinateSpace.MinY() + yOffset + (ySpacing * .5f);

        screenPosition     = new Vector3(xPos, yPos, 0);
        transform.position = screenPosition;
    }