コード例 #1
0
ファイル: AreaView.cs プロジェクト: Khas195/GamerBoiz-Weekone
    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);
    }