コード例 #1
0
    public void SetZoomSize(float zoom)
    {
        float zoomMultipler = -1 * (1 - zoom);
        float finalZoom     = (1 + zoomMultipler);

        if (zoom <= 0.0626f)
        {
            finalZoom = 0.18f;
        }
        else if (zoom <= 0.126f)
        {
            finalZoom = 0.3f;
        }
        else if (finalZoom < 0.4f && zoom <= 2.5f)
        {
            finalZoom = 0.4f;
        }
        else if (zoom >= 2.5f)
        {
            float smallSize = 0.4f - (float)zoomMultipler / 100;
            smallSize *= 10;
            if (finalZoom >= smallSize)
            {
                finalZoom = smallSize;
            }
        }
        if (zoom >= 14)
        {
            finalZoom = 2.5f;
        }
        finalZoom *= scaleNormal;
        mapObject.transform.localScale = new Vector3(finalZoom, finalZoom, 1f);

        if (mapObject != null)
        {
            mapObject.ChangeIconVisible(zoom);
        }
    }