Example #1
0
    // Use this for initialization
    void Start()
    {
        if (player == null)
        {
            player = GameObject.FindWithTag("Player").transform;
        }
        target = player.transform.position;

        min = map.LocalToWorld(map.localBounds.min);
        max = map.LocalToWorld(map.localBounds.max);

        Camera cam = GetComponent <Camera>();

        height = cam.orthographicSize;
        width  = ((float)cam.pixelWidth / cam.pixelHeight) * height;
        Debug.Log("width and height: " + height.ToString() + ", " + width.ToString());
    }