Example #1
0
    public void View()
    {
        if (isViewing)
        {
            return;
        }

        cameraFollow.Clear(true);
        cameraZoom.Clear(true);

        cachedFocusCenterPercentage = cameraFollow.GetFollowPercentage();
        cachedZoomFollowPercentage  = cameraZoom.GetFollowPercentage();
        cachedZoomValued            = cameraZoom.GetMaxZoom();

        cameraFollow.SetFollowPercentage(focusCenterPercentage);
        cameraZoom.SetFollowPercentage(zoomFollowPercentage);
        cameraZoom.SetMaxZoom(personalMaxZoom);

        foreach (var obj in objectsInArea)
        {
            cameraFollow.AddEncapsolateObject(obj);
            cameraZoom.AddEncapsolateObject(obj);
        }

        isViewing = true;
        Invoke("UnView", viewTime);
    }