Add a system for setting up "real" camera framing to work between devices (#26)

- In-level authoring utility to designate level bounds
- Camera Adapter component to be placed on a level's camera to perform the adjustments
- EdgeAnchor tool, which allows anchoring of game objects to the screen bounds

Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Reviewed-on: #26
This commit is contained in:
2025-10-14 04:56:00 +00:00
parent aefff3d050
commit 2573e7f80e
12 changed files with 1261 additions and 134 deletions

View File

@@ -342,17 +342,17 @@ LineRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_Positions:
- {x: -0.15602553, y: 3.8573277, z: 0}
- {x: -0.1566351, y: 3.753693, z: 0}
- {x: -0.1572447, y: 3.6518767, z: 0}
- {x: -0.15785426, y: 3.5518785, z: 0}
- {x: -0.15846384, y: 3.453699, z: 0}
- {x: -0.15907341, y: 3.3573375, z: 0}
- {x: -0.15968299, y: 3.2627945, z: 0}
- {x: -0.16029257, y: 3.1700697, z: 0}
- {x: -0.16090216, y: 3.0791638, z: 0}
- {x: -0.16151173, y: 2.9900756, z: 0}
- {x: -0.16212131, y: 2.9028063, z: 0}
- {x: -0.15602553, y: 4.0749445, z: 0}
- {x: -0.1566351, y: 3.9736378, z: 0}
- {x: -0.1572447, y: 3.8729858, z: 0}
- {x: -0.15785426, y: 3.7729874, z: 0}
- {x: -0.15846384, y: 3.6736438, z: 0}
- {x: -0.15907341, y: 3.5749543, z: 0}
- {x: -0.15968299, y: 3.4769194, z: 0}
- {x: -0.16029257, y: 3.3795385, z: 0}
- {x: -0.16090216, y: 3.2828126, z: 0}
- {x: -0.16151173, y: 3.1867406, z: 0}
- {x: -0.16212131, y: 3.0913231, z: 0}
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
@@ -454,6 +454,7 @@ GameObject:
- component: {fileID: 224729333}
- component: {fileID: 224729332}
- component: {fileID: 224729334}
- component: {fileID: 224729335}
m_Layer: 0
m_Name: CinemachineCamera
m_TagString: Untagged
@@ -541,6 +542,21 @@ Animator:
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!114 &224729335
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 224729330}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8a71a21143bd4f4992d08829084d1e3b, type: 3}
m_Name:
m_EditorClassIdentifier: AppleHillsScripts::AppleHillsCamera.CameraScreenAdapter
referenceMarker: {fileID: 1651034645}
adjustOnStart: 1
adjustOnScreenResize: 1
--- !u!1 &323864663
GameObject:
m_ObjectHideFlags: 0
@@ -882,6 +898,7 @@ GameObject:
- component: {fileID: 747976404}
- component: {fileID: 747976405}
- component: {fileID: 747976406}
- component: {fileID: 747976407}
m_Layer: 0
m_Name: BottleMarine
m_TagString: Player
@@ -898,7 +915,7 @@ Transform:
m_GameObject: {fileID: 747976396}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.9799, z: 0}
m_LocalPosition: {x: 0, y: 3.1975174, z: 0}
m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574}
m_ConstrainProportionsScale: 0
m_Children:
@@ -918,6 +935,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d39dbaae819c4a128a11ca60fbbc98c9, type: 3}
m_Name:
m_EditorClassIdentifier:
edgeAnchor: {fileID: 747976407}
--- !u!114 &747976399
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -1089,6 +1107,31 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier: AppleHillsScripts::Minigames.DivingForPictures.Utilities.BottlePauser
wobbleReference: {fileID: 747976399}
--- !u!114 &747976407
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 747976396}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ed380d10e1e04ae7990e5c726c929063, type: 3}
m_Name:
m_EditorClassIdentifier: AppleHillsScripts::AppleHillsCamera.EdgeAnchor
referenceMarker: {fileID: 1651034645}
cameraAdapter: {fileID: 224729335}
anchorEdge: 0
useReferenceMargin: 0
customMargin: 2
adjustOnStart: 1
adjustOnScreenResize: 0
preserveOtherAxes: 1
accountForObjectSize: 1
showVisualization: 1
visualizationColor: {r: 1, g: 0, b: 1, a: 1}
showObjectBounds: 1
debugMode: 0
--- !u!1 &824396214
GameObject:
m_ObjectHideFlags: 0
@@ -1324,17 +1367,17 @@ LineRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_Positions:
- {x: -0.15602553, y: 3.8573277, z: 0}
- {x: -0.11662118, y: 3.66006, z: 0}
- {x: -0.07721684, y: 3.4853156, z: 0}
- {x: -0.03781248, y: 3.3330944, z: 0}
- {x: 0.0015918687, y: 3.2033968, z: 0}
- {x: 0.040996216, y: 3.0962222, z: 0}
- {x: 0.08040057, y: 3.011571, z: 0}
- {x: 0.11980491, y: 2.9494433, z: 0}
- {x: 0.15920927, y: 2.9098392, z: 0}
- {x: 0.1986136, y: 2.892758, z: 0}
- {x: 0.23801796, y: 2.8982003, z: 0}
- {x: -0.15602553, y: 4.074945, z: 0}
- {x: -0.11662118, y: 3.8796225, z: 0}
- {x: -0.07721684, y: 3.7057445, z: 0}
- {x: -0.03781248, y: 3.5533106, z: 0}
- {x: 0.0015918687, y: 3.4223216, z: 0}
- {x: 0.040996216, y: 3.3127766, z: 0}
- {x: 0.08040057, y: 3.2246757, z: 0}
- {x: 0.11980491, y: 3.1580195, z: 0}
- {x: 0.15920927, y: 3.1128078, z: 0}
- {x: 0.1986136, y: 3.0890403, z: 0}
- {x: 0.23801796, y: 3.0867171, z: 0}
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
@@ -1867,17 +1910,17 @@ LineRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_Positions:
- {x: -0.15602553, y: 3.8573277, z: 0}
- {x: -0.18956745, y: 3.6568341, z: 0}
- {x: -0.22310936, y: 3.479415, z: 0}
- {x: -0.25665125, y: 3.3250687, z: 0}
- {x: -0.29019317, y: 3.193797, z: 0}
- {x: -0.32373506, y: 3.0855987, z: 0}
- {x: -0.35727698, y: 3.0004745, z: 0}
- {x: -0.39081886, y: 2.938424, z: 0}
- {x: -0.4243608, y: 2.8994474, z: 0}
- {x: -0.45790267, y: 2.8835444, z: 0}
- {x: -0.4914446, y: 2.8907156, z: 0}
- {x: -0.15602553, y: 4.074945, z: 0}
- {x: -0.18956745, y: 3.8764977, z: 0}
- {x: -0.22310936, y: 3.7000232, z: 0}
- {x: -0.25665125, y: 3.5455205, z: 0}
- {x: -0.29019317, y: 3.4129908, z: 0}
- {x: -0.32373506, y: 3.3024333, z: 0}
- {x: -0.35727698, y: 3.213848, z: 0}
- {x: -0.39081886, y: 3.1472356, z: 0}
- {x: -0.4243608, y: 3.1025953, z: 0}
- {x: -0.45790267, y: 3.0799277, z: 0}
- {x: -0.4914446, y: 3.0792325, z: 0}
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
@@ -1968,6 +2011,59 @@ MonoBehaviour:
ropeDamping: 0.3
initialSeparationDistance: 0.1
initialFallImpulse: 2
--- !u!1 &1651034644
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1651034646}
- component: {fileID: 1651034645}
m_Layer: 0
m_Name: ScreenReferenceMarker
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1651034645
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1651034644}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3058fe4801134fea916ad685f924668f, type: 3}
m_Name:
m_EditorClassIdentifier: AppleHillsScripts::AppleHillsCamera.ScreenReferenceMarker
targetWidth: 6.2
topMargin: 0.2
bottomMargin: 0.2
leftMargin: 0.2
rightMargin: 0.2
gizmoColor: {r: 0, g: 1, b: 0, a: 0.5}
screenEdgeColor: {r: 1, g: 1, b: 0, a: 0.3}
showVerticalMargins: 1
showHorizontalMargins: 1
--- !u!4 &1651034646
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1651034644}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1679185997
GameObject:
m_ObjectHideFlags: 0
@@ -2031,6 +2127,7 @@ MonoBehaviour:
- {fileID: 2956826569642009690, guid: b3501bc08c6afbf4f868bc7b6c2a2d92, type: 3}
- {fileID: 2956826569642009690, guid: 4f9c8bd3fb844484492a54a2998b9b3b, type: 3}
- {fileID: 2956826569642009690, guid: 16ad8a46d2c7c534982f4ee943e06f74, type: 3}
initialTilePrefab: {fileID: 0}
onTileSpawned:
m_PersistentCalls:
m_Calls: []
@@ -2040,6 +2137,22 @@ MonoBehaviour:
onLastTileLeft:
m_PersistentCalls:
m_Calls: []
depthDifficultyRanges:
- minDepth: 0
maxDepth: 10
difficulty: 1
- minDepth: 11
maxDepth: 20
difficulty: 2
- minDepth: 21
maxDepth: 30
difficulty: 3
- minDepth: 31
maxDepth: 40
difficulty: 4
- minDepth: 41
maxDepth: 2147483647
difficulty: 5
--- !u!1 &1787733334
GameObject:
m_ObjectHideFlags: 0
@@ -2337,7 +2450,7 @@ Transform:
m_GameObject: {fileID: 2106431001}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.165, y: 2.509, z: 0}
m_LocalPosition: {x: -0.165, y: 2.697517, z: 0}
m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574}
m_ConstrainProportionsScale: 0
m_Children:
@@ -2366,7 +2479,7 @@ MonoBehaviour:
bottleWobble: {fileID: 747976399}
followStiffness: 4
useWobbleOffset: 1
baseY: 2.5
verticalDistance: 0.5
--- !u!114 &2106431004
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -2410,3 +2523,4 @@ SceneRoots:
- {fileID: 1679185998}
- {fileID: 323864665}
- {fileID: 424805726}
- {fileID: 1651034646}