예제 #1
0
        void FitCamera()
        {
            var     cellMin = puzzleManager.tilemapNavigation.Min;
            var     cellmax = puzzleManager.tilemapNavigation.Max;
            Vector2 min     = (Vector2)puzzleManager.tilemapNavigation.CellToWorld(cellMin);
            Vector2 max     = puzzleManager.tilemapNavigation.CellToWorld(cellmax);

            min = min - Vector2.one;
            max = max + Vector2.one;
            Rect w = new Rect();

            w.min = min;
            w.max = max;
            CameraUtility.SetCameraToRect(w);
        }