Merge branch 'master' of github.com:WillJeynes/Brackeys2026-2

This commit is contained in:
WillJeynes
2026-08-29 20:44:29 +01:00
6 changed files with 922 additions and 364 deletions
+6 -6
View File
@@ -381,7 +381,7 @@ Transform:
m_GameObject: {fileID: 2658980241334070197}
serializedVersion: 2
m_LocalRotation: {x: 0.07358181, y: 0.06576601, z: -0.0048629786, w: 0.99510646}
m_LocalPosition: {x: 0.021, y: 0.554, z: -5.19}
m_LocalPosition: {x: 0.020576129, y: 0.55308634, z: -10.600001}
m_LocalScale: {x: 0.41152364, y: 0.2469134, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -747,7 +747,7 @@ Transform:
m_GameObject: {fileID: 5594795846395120415}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.021, y: 0.554, z: -5.19}
m_LocalPosition: {x: 0.021, y: 0.554, z: -9.62}
m_LocalScale: {x: 0.4115226, y: 0.24691355, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -782,9 +782,9 @@ MonoBehaviour:
- m_EditModeType: 1
m_Knots:
- Position:
x: 0
y: 0
z: 0
x: -0.0010300055
y: -0.0037002563
z: -0.98000145
TangentIn:
x: 0
y: 0
@@ -802,7 +802,7 @@ MonoBehaviour:
- Position:
x: -0.19103001
y: -0.0037002563
z: 10.25
z: 21.71
TangentIn:
x: 0
y: 0
+290
View File
@@ -140,6 +140,152 @@ MonoBehaviour:
Time: 0
Smoothing: 0
IgnoreY: 0
--- !u!1 &171430610746948940
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8486146361536531750}
- component: {fileID: 8460338616522548121}
- component: {fileID: 5622283389732489967}
m_Layer: 0
m_Name: Dolly Spline
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8486146361536531750
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 171430610746948940}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.021, y: 0.554, z: -5.19}
m_LocalScale: {x: 0.4115226, y: 0.24691355, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6261725771962263685}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8460338616522548121
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 171430610746948940}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dab5c7d4c32e743048dfca98e2d5914f, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Splines::UnityEngine.Splines.SplineContainer
m_Spline:
m_EditModeType: 1
m_Knots: []
m_MetaData: []
m_Closed: 0
m_IntData:
m_Data: []
m_FloatData:
m_Data: []
m_Float4Data:
m_Data: []
m_ObjectData:
m_Data: []
m_Splines:
- m_EditModeType: 1
m_Knots:
- Position:
x: 0
y: 0
z: 0
TangentIn:
x: 0
y: 0
z: -1.6045649
TangentOut:
x: 0
y: 0
z: 1.6045649
Rotation:
value:
x: 0.0008891812
y: -0.011103801
z: 0.000025192192
w: 0.999938
- Position:
x: -0.17103
y: -0.013700247
z: 7.7
TangentIn:
x: 0
y: 0
z: -1.2836514
TangentOut:
x: 0
y: 0
z: 1.2836514
Rotation:
value:
x: 0.0008894407
y: -0.011103782
z: 0.0000018435329
w: 0.999938
- Position:
x: -0.25103
y: -257.7437
z: 9.09
TangentIn:
x: 0
y: 0
z: 0
TangentOut:
x: 0
y: 0
z: 0
Rotation:
value:
x: 0.0008893516
y: -0.011103789
z: 0.0000098757855
w: 0.99993795
m_MetaData:
- Mode: 2
Tension: 0.5
- Mode: 2
Tension: 0.5
- Mode: 1
Tension: 0.5
m_Closed: 0
m_IntData:
m_Data: []
m_FloatData:
m_Data: []
m_Float4Data:
m_Data: []
m_ObjectData:
m_Data: []
m_Knots:
m_KnotsLink: []
--- !u!114 &5622283389732489967
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 171430610746948940}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c5342500578afb24a9b83d6343d32a0f, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Cinemachine::Unity.Cinemachine.CinemachineSplineSmoother
AutoSmooth: 0
--- !u!1 &1857798259198218514
GameObject:
m_ObjectHideFlags: 0
@@ -554,6 +700,8 @@ Transform:
- {fileID: 34709828658865169}
- {fileID: 7948981819171241343}
- {fileID: 912666790872368808}
- {fileID: 5763264831821740971}
- {fileID: 8486146361536531750}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &7866095202227853034
@@ -596,6 +744,148 @@ MonoBehaviour:
isfocussed: 0
doorCamera: {fileID: 3247703817837353023}
doorSplineDolly: {fileID: 3385227337432197715}
deathCamera: {fileID: 2529712832601522221}
deathSplineDolly: {fileID: 5276452210671894326}
--- !u!1 &6648741166833317941
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5763264831821740971}
- component: {fileID: 2529712832601522221}
- component: {fileID: 5276452210671894326}
- component: {fileID: 346132022937810732}
m_Layer: 0
m_Name: DeathCam
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5763264831821740971
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6648741166833317941}
serializedVersion: 2
m_LocalRotation: {x: 0.18944009, y: 0.64427394, z: -0.16919321, w: 0.72138566}
m_LocalPosition: {x: 0.021, y: 0.554, z: -5.19}
m_LocalScale: {x: 0.4115226, y: 0.24691355, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6261725771962263685}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2529712832601522221
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6648741166833317941}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f9dfa5b682dcd46bda6128250e975f58, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Cinemachine::Unity.Cinemachine.CinemachineCamera
Priority:
Enabled: 0
m_Value: 0
OutputChannel: 1
StandbyUpdate: 2
m_StreamingVersion: 20241001
m_LegacyPriority: 0
Target:
TrackingTarget: {fileID: 0}
LookAtTarget: {fileID: 0}
CustomLookAtTarget: 0
Lens:
FieldOfView: 60.000004
OrthographicSize: 5
NearClipPlane: 0.3
FarClipPlane: 1000
Dutch: 0
ModeOverride: 0
PhysicalProperties:
GateFit: 2
SensorSize: {x: 21.946, y: 16.002}
LensShift: {x: 0, y: 0}
FocusDistance: 10
Iso: 200
ShutterSpeed: 0.005
Aperture: 16
BladeCount: 5
Curvature: {x: 2, y: 11}
BarrelClipping: 0.25
Anamorphism: 0
BlendHint: 0
--- !u!114 &5276452210671894326
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6648741166833317941}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 90eebaab98e4b44b0ba8c79821e554e1, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Cinemachine::Unity.Cinemachine.CinemachineSplineDolly
m_SplineSettings:
Spline: {fileID: 8460338616522548121}
Position: 0
Units: 1
SplineOffset: {x: 0, y: 0, z: 0}
CameraRotation: 0
Damping:
Enabled: 0
Position: {x: 0, y: 0, z: 0}
Angular: 0
AutomaticDolly:
Enabled: 0
Method:
rid: -2
m_LegacyPosition: -1
m_LegacyUnits: 0
m_LegacySpline: {fileID: 0}
references:
version: 2
RefIds:
- rid: -2
type: {class: , ns: , asm: }
--- !u!114 &346132022937810732
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6648741166833317941}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f38bda98361e1de48a4ca2bd86ea3c17, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Cinemachine::Unity.Cinemachine.CinemachineRotationComposer
Composition:
ScreenPosition: {x: 0, y: 0}
DeadZone:
Enabled: 0
Size: {x: 0.2, y: 0.2}
HardLimits:
Enabled: 0
Size: {x: 0.8, y: 0.8}
Offset: {x: 0, y: 0}
CenterOnActivate: 1
TargetOffset: {x: 0, y: 0, z: 0}
Damping: {x: 0.5, y: 0.5}
Lookahead:
Enabled: 0
Time: 0
Smoothing: 0
IgnoreY: 0
--- !u!1 &8392774035223462151
GameObject:
m_ObjectHideFlags: 0
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ce995914cc8af1826b3ca2eae230fa5f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+272 -64
View File
@@ -4684,37 +4684,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 794486860}
m_CullTransparentMesh: 1
--- !u!1 &813747523
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 813747524}
m_Layer: 0
m_Name: CamStartPos
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &813747524
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 813747523}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 24.62, y: 5, z: -42.67}
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 &823145082
GameObject:
m_ObjectHideFlags: 0
@@ -5662,6 +5631,132 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1010843661}
m_CullTransparentMesh: 1
--- !u!1 &1026739743
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1026739746}
- component: {fileID: 1026739745}
- component: {fileID: 1026739744}
m_Layer: 0
m_Name: Dolly Spline
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1026739744
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1026739743}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c5342500578afb24a9b83d6343d32a0f, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Cinemachine::Unity.Cinemachine.CinemachineSplineSmoother
AutoSmooth: 1
--- !u!114 &1026739745
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1026739743}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dab5c7d4c32e743048dfca98e2d5914f, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Splines::UnityEngine.Splines.SplineContainer
m_Spline:
m_EditModeType: 1
m_Knots: []
m_MetaData: []
m_Closed: 0
m_IntData:
m_Data: []
m_FloatData:
m_Data: []
m_Float4Data:
m_Data: []
m_ObjectData:
m_Data: []
m_Splines:
- m_EditModeType: 1
m_Knots:
- Position:
x: 0
y: 0
z: -0.06800079
TangentIn:
x: 0
y: 0
z: 0
TangentOut:
x: 0
y: 0
z: 0
Rotation:
value:
x: -0.19298117
y: 0.25777513
z: 0.0526258
w: 0.94527286
- Position:
x: 0.7800007
y: 0.65999985
z: 21.761
TangentIn:
x: 0
y: 0
z: -0.55701405
TangentOut:
x: 0
y: 0
z: 0.55701405
Rotation:
value:
x: -0.19298117
y: 0.25777513
z: 0.0526258
w: 0.94527286
m_MetaData:
- Mode: 1
Tension: 0.5
- Mode: 2
Tension: 0.5
m_Closed: 0
m_IntData:
m_Data: []
m_FloatData:
m_Data: []
m_Float4Data:
m_Data: []
m_ObjectData:
m_Data: []
m_Knots:
m_KnotsLink: []
--- !u!4 &1026739746
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1026739743}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 25, y: 5, z: -52}
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 &1033540269
GameObject:
m_ObjectHideFlags: 0
@@ -7733,6 +7828,146 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1384402512}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1419548891
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1419548895}
- component: {fileID: 1419548894}
- component: {fileID: 1419548893}
- component: {fileID: 1419548892}
m_Layer: 0
m_Name: IntroCam
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1419548892
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1419548891}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f38bda98361e1de48a4ca2bd86ea3c17, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Cinemachine::Unity.Cinemachine.CinemachineRotationComposer
Composition:
ScreenPosition: {x: 0, y: 0}
DeadZone:
Enabled: 0
Size: {x: 0.2, y: 0.2}
HardLimits:
Enabled: 0
Size: {x: 0.8, y: 0.8}
Offset: {x: 0, y: 0}
CenterOnActivate: 1
TargetOffset: {x: 0, y: 0, z: 0}
Damping: {x: 0.5, y: 0.5}
Lookahead:
Enabled: 0
Time: 0
Smoothing: 0
IgnoreY: 0
--- !u!114 &1419548893
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1419548891}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 90eebaab98e4b44b0ba8c79821e554e1, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Cinemachine::Unity.Cinemachine.CinemachineSplineDolly
m_SplineSettings:
Spline: {fileID: 1026739745}
Position: 0
Units: 1
SplineOffset: {x: 0, y: 0, z: 0}
CameraRotation: 0
Damping:
Enabled: 0
Position: {x: 0, y: 0, z: 0}
Angular: 0
AutomaticDolly:
Enabled: 0
Method:
rid: -2
m_LegacyPosition: -1
m_LegacyUnits: 0
m_LegacySpline: {fileID: 0}
references:
version: 2
RefIds:
- rid: -2
type: {class: , ns: , asm: }
--- !u!114 &1419548894
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1419548891}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f9dfa5b682dcd46bda6128250e975f58, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Cinemachine::Unity.Cinemachine.CinemachineCamera
Priority:
Enabled: 0
m_Value: 0
OutputChannel: 1
StandbyUpdate: 2
m_StreamingVersion: 20241001
m_LegacyPriority: 0
Target:
TrackingTarget: {fileID: 0}
LookAtTarget: {fileID: 0}
CustomLookAtTarget: 0
Lens:
FieldOfView: 60.000004
OrthographicSize: 5
NearClipPlane: 0.3
FarClipPlane: 1000
Dutch: 0
ModeOverride: 0
PhysicalProperties:
GateFit: 2
SensorSize: {x: 21.946, y: 16.002}
LensShift: {x: 0, y: 0}
FocusDistance: 10
Iso: 200
ShutterSpeed: 0.005
Aperture: 16
BladeCount: 5
Curvature: {x: 2, y: 11}
BarrelClipping: 0.25
Anamorphism: 0
BlendHint: 0
--- !u!4 &1419548895
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1419548891}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 25, y: 5, z: -52.068}
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 &1425902180
GameObject:
m_ObjectHideFlags: 0
@@ -9168,6 +9403,10 @@ MonoBehaviour:
explorationCamera: {fileID: 17649578}
activePriority: 20
inactivePriority: 10
introCamera: {fileID: 1419548894}
introSplineDolly: {fileID: 1419548893}
introHoldTime: 0
blendDuration: 0
mainUnityCamera: {fileID: 330585545}
interactableLayer:
serializedVersion: 2
@@ -10427,37 +10666,6 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -20, y: -20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &2057252392
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2057252393}
m_Layer: 0
m_Name: CamPlayPos
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2057252393
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2057252392}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 25, y: 5, z: -30}
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 &2068975855
GameObject:
m_ObjectHideFlags: 0
@@ -10777,5 +10985,5 @@ SceneRoots:
- {fileID: 17649579}
- {fileID: 1277677658}
- {fileID: 1743187106}
- {fileID: 813747524}
- {fileID: 2057252393}
- {fileID: 1419548895}
- {fileID: 1026739746}
+343 -294
View File
@@ -7,350 +7,399 @@ using System.Collections;
public class CameraController : MonoBehaviour
{
[Header("Cinemachine 3 Setup")]
public CinemachineCamera focusCameraA;
public CinemachineCamera focusCameraB;
public CinemachineCamera explorationCamera;
public int activePriority = 20;
public int inactivePriority = 10;
    [Header("Cinemachine 3 Setup")]
    public CinemachineCamera focusCameraA;
    public CinemachineCamera focusCameraB;
    public CinemachineCamera explorationCamera;
   
    public int activePriority = 20;
    public int inactivePriority = 10;
[Header("Raycast Setup")]
public Camera mainUnityCamera;
public LayerMask interactableLayer;
    [Header("Intro Sequence Setup")]
    [Tooltip("The camera placed high up to show the whole room.")]
    public CinemachineCamera introCamera;
public CinemachineSplineDolly introSplineDolly;
 
    public float introHoldTime = 2f;
    [Tooltip("How long the Cinemachine blend takes to sweep down to the player.")]
    public float blendDuration = 2f;
[Header("UI Setup")]
public Button talkButton;
public Button doorButton;
private GuardManager currentGuardManager;
private DoorManager currentDoorManager;
    [Header("Raycast Setup")]
    public Camera mainUnityCamera;
    public LayerMask interactableLayer;
[Header("Hover Highlight Settings")]
public Color highlightColour = Color.yellow;
private Renderer currentlyHoveredRenderer;
private Color originalColour;
    [Header("UI Setup")]
    public Button talkButton;
    public Button doorButton;
    private GuardManager currentGuardManager;
    private DoorManager currentDoorManager;
[Header("Exploration Nudge Settings")]
public float nudgeSpeed = 15f;
public float maxNudgeAngle = 8f;
public float edgeThickness = 50f;
    [Header("Hover Highlight Settings")]
    public Color highlightColour = Color.yellow;
    private Renderer currentlyHoveredRenderer;
    private Color originalColour;
[Header("Focus Nudge Settings")]
public float focusNudgeSpeed = 5f;
public float maxFocusOffset = 2f;
    [Header("Exploration Nudge Settings")]
    public float nudgeSpeed = 15f;
    public float maxNudgeAngle = 8f;
    public float edgeThickness = 50f;
private Quaternion startingRotation;
private float currentYaw = 0f;
    [Header("Focus Nudge Settings")]
    public float focusNudgeSpeed = 5f;
    public float maxFocusOffset = 2f;
private bool useCameraA = true;
private Transform dynamicFocusTargetA;
private Transform dynamicFocusTargetB;
private Transform activeDynamicTarget;
private Transform currentInteractableTransform;
private float currentFocusOffsetX = 0f;
private bool isSequencePlaying = false;
    private Quaternion startingRotation;
    private float currentYaw = 0f;
void Start()
    private bool useCameraA = true;
    private Transform dynamicFocusTargetA;
    private Transform dynamicFocusTargetB;
    private Transform activeDynamicTarget;
    private Transform currentInteractableTransform;
   
    private float currentFocusOffsetX = 0f;
    private bool isSequencePlaying = false;
    void Start()
    {
        if (explorationCamera != null)
        {
            startingRotation = explorationCamera.transform.rotation;
        }
        dynamicFocusTargetA = new GameObject("DynamicFocusTarget_A").transform;
        dynamicFocusTargetB = new GameObject("DynamicFocusTarget_B").transform;
        if (talkButton != null)
        {
            talkButton.gameObject.SetActive(false);
            talkButton.onClick.AddListener(OnTalkButtonClicked);
        }
        if (doorButton != null)
        {
            doorButton.gameObject.SetActive(false);
            doorButton.onClick.AddListener(OnDoorButtonClicked);
        }
        // Play the intro sweep straight away when the game first loads!
        if (introCamera != null)
        {
            StartCoroutine(IntroSequenceRoutine());
        }
    }
    void Update()
    {
        // Allow the Escape key to skip intro sequences or drop interactions at any time
        if (Keyboard.current != null && Keyboard.current.escapeKey.wasPressedThisFrame)
        {
            StopAllCoroutines();
            isSequencePlaying = false;
            ResetCameraPositions();
        }
        if (Mouse.current == null || isSequencePlaying) return;
        HandleHover();
        HandleEdgeNudge();
        if (Mouse.current.leftButton.wasPressedThisFrame)
        {
            if (EventSystem.current != null && EventSystem.current.IsPointerOverGameObject())
            {
                return;
            }
            HandleInteractionClick();
        }
       
        if (Mouse.current.rightButton.wasPressedThisFrame)
        {
            ReturnToMainCamera();
        }
    }
    private IEnumerator IntroSequenceRoutine()
{
if (explorationCamera != null)
{
startingRotation = explorationCamera.transform.rotation;
}
// If you haven't assigned an intro camera yet, just skip this
if (introCamera == null) yield break;
dynamicFocusTargetA = new GameObject("DynamicFocusTarget_A").transform;
dynamicFocusTargetB = new GameObject("DynamicFocusTarget_B").transform;
if (talkButton != null)
{
talkButton.gameObject.SetActive(false);
talkButton.onClick.AddListener(OnTalkButtonClicked);
}
if (doorButton != null)
{
doorButton.gameObject.SetActive(false);
doorButton.onClick.AddListener(OnDoorButtonClicked);
}
}
void Update()
{
if (Mouse.current == null || isSequencePlaying) return;
HandleHover();
HandleEdgeNudge();
if (Mouse.current.leftButton.wasPressedThisFrame)
{
if (EventSystem.current != null && EventSystem.current.IsPointerOverGameObject())
{
return;
}
HandleInteractionClick();
}
// Lock controls
isSequencePlaying = true;
RemoveHighlight();
if (Mouse.current.rightButton.wasPressedThisFrame)
// If we have a track, reset the camera to the very start of it
if (introSplineDolly != null)
{
ReturnToMainCamera();
introSplineDolly.CameraPosition = 0f;
}
if (Keyboard.current != null && Keyboard.current.escapeKey.wasPressedThisFrame)
// Snap to the intro camera
introCamera.Priority = 30;
// If we have a track, push the camera along it smoothly!
if (introSplineDolly != null)
{
ResetCameraPositions();
}
}
private void HandleEdgeNudge()
{
Vector2 mousePos = Mouse.current.position.ReadValue();
float yawInput = 0f;
if (mousePos.x < edgeThickness) yawInput = -1f;
else if (mousePos.x > Screen.width - edgeThickness) yawInput = 1f;
bool isFocused = focusCameraA.Priority >= activePriority || focusCameraB.Priority >= activePriority;
if (yawInput != 0f)
{
if (isFocused && currentInteractableTransform != null && activeDynamicTarget != null)
float elapsedTime = 0f;
while (elapsedTime < introHoldTime)
{
currentFocusOffsetX += yawInput * focusNudgeSpeed * Time.deltaTime;
currentFocusOffsetX = Mathf.Clamp(currentFocusOffsetX, -maxFocusOffset, maxFocusOffset);
activeDynamicTarget.position = currentInteractableTransform.position
+ (mainUnityCamera.transform.right * currentFocusOffsetX);
elapsedTime += Time.deltaTime;
// This maths magically moves it from 0 to 1 perfectly timed to your introHoldTime
introSplineDolly.CameraPosition = Mathf.Lerp(0f, 1f, elapsedTime / introHoldTime);
yield return null;
}
else if (!isFocused && explorationCamera != null)
{
currentYaw += yawInput * nudgeSpeed * Time.deltaTime;
currentYaw = Mathf.Clamp(currentYaw, -maxNudgeAngle, maxNudgeAngle);
Quaternion yawRotation = Quaternion.AngleAxis(currentYaw, Vector3.up);
explorationCamera.transform.rotation = startingRotation * yawRotation;
}
}
}
private void HandleHover()
{
Vector2 mousePos = Mouse.current.position.ReadValue();
Ray ray = mainUnityCamera.ScreenPointToRay(mousePos);
if (Physics.Raycast(ray, out RaycastHit hit, 100f, interactableLayer))
{
Renderer hitRenderer = hit.transform.GetComponentInChildren<Renderer>();
if (hitRenderer != null && hitRenderer != currentlyHoveredRenderer)
{
RemoveHighlight();
currentlyHoveredRenderer = hitRenderer;
if (
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>() != null &&
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>() != currentDoorManager
)
{
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>().isfocussed = 1;
}
if (
currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>() != null &&
currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>() != currentGuardManager
)
{
currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>().isfocussed = 1;
}
}
// Make sure it snaps perfectly to the end (1.0)
introSplineDolly.CameraPosition = 1f;
}
else
{
RemoveHighlight();
// If you didn't plug in a spline, just wait normally
yield return new WaitForSeconds(introHoldTime);
}
// Drop priority so Cinemachine blends down to the exploration camera
introCamera.Priority = inactivePriority;
// Wait whilst the camera physically travels downwards
yield return new WaitForSeconds(blendDuration);
// Unlock controls
isSequencePlaying = false;
}
private void RemoveHighlight()
{
if (currentlyHoveredRenderer != null)
{
if (
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>() != null &&
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>() != currentDoorManager
)
{
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>().isfocussed = 0;
}
if (
currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>() != null &&
currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>() != currentGuardManager
)
{
currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>().isfocussed = 0;
}
currentlyHoveredRenderer = null;
}
}
private void HandleInteractionClick()
{
Vector2 mousePos = Mouse.current.position.ReadValue();
Ray ray = mainUnityCamera.ScreenPointToRay(mousePos);
if (Physics.Raycast(ray, out RaycastHit hit, 100f, interactableLayer))
{
currentInteractableTransform = hit.transform;
currentFocusOffsetX = 0f;
CinemachineCamera nextCam = useCameraA ? focusCameraA : focusCameraB;
CinemachineCamera oldCam = useCameraA ? focusCameraB : focusCameraA;
Transform nextTarget = useCameraA ? dynamicFocusTargetA : dynamicFocusTargetB;
nextTarget.position = currentInteractableTransform.position;
nextCam.Follow = currentInteractableTransform;
nextCam.LookAt = nextTarget;
nextCam.Priority = activePriority;
oldCam.Priority = inactivePriority;
activeDynamicTarget = nextTarget;
useCameraA = !useCameraA;
GuardManager guard = hit.transform.GetComponent<GuardManager>();
DoorManager door = hit.transform.GetComponent<DoorManager>();
if (talkButton != null) talkButton.gameObject.SetActive(false);
if (doorButton != null) doorButton.gameObject.SetActive(false);
UnsetAll();
if (guard != null)
{
TutorialManager.Instance.LogAction("TAP");
currentGuardManager = guard;
guard.isfocussed = 2;
if (talkButton != null) talkButton.gameObject.SetActive(true);
}
else if (door != null)
{
TutorialManager.Instance.LogAction("TAP");
currentDoorManager = door;
door.isfocussed = 2;
if (doorButton != null) doorButton.gameObject.SetActive(true);
}
}
else
{
ReturnToMainCamera();
UnsetAll();
}
}
private void OnTalkButtonClicked()
{
if (currentGuardManager != null)
{
DialogManager.Instance.StartDialog(currentGuardManager);
// talkButton.gameObject.SetActive(false);
}
}
private void OnDoorButtonClicked()
{
if (currentDoorManager != null && currentDoorManager.doorCamera != null && currentDoorManager.doorSplineDolly != null)
{
doorButton.gameObject.SetActive(false);
StartCoroutine(DoorSequenceRoutine(currentDoorManager));
}
else
{
Debug.LogError("The DoorManager is missing its Camera or Spline Dolly references!");
}
}
private IEnumerator DoorSequenceRoutine(DoorManager activeDoor)
    private IEnumerator DoorSequenceRoutine(DoorManager activeDoor)
{
isSequencePlaying = true;
RemoveHighlight();
activeDoor.doorSplineDolly.CameraPosition = 0f;
activeDoor.doorCamera.Priority = 30;
// 1. Determine which camera and track to use based on the door type
bool isDeathDoor = activeDoor.type == "DEATH" && activeDoor.deathCamera != null;
CinemachineCamera activeCam = isDeathDoor ? activeDoor.deathCamera : activeDoor.doorCamera;
CinemachineSplineDolly activeDolly = isDeathDoor ? activeDoor.deathSplineDolly : activeDoor.doorSplineDolly;
// 2. Reset the chosen track and boost its priority
activeDolly.CameraPosition = 0f;
activeCam.Priority = 30;
yield return new WaitForSeconds(0.5f);
// 3. Push the camera (You might want to speed this up for the death drop!)
float pushSpeed = 0.5f;
// Push the camera through the doorway
while (activeDoor.doorSplineDolly.CameraPosition < 1f)
while (activeDoor != null && activeDolly != null && activeDolly.CameraPosition < 1f)
{
activeDoor.doorSplineDolly.CameraPosition += pushSpeed * Time.deltaTime;
activeDolly.CameraPosition += pushSpeed * Time.deltaTime;
yield return null;
}
activeDoor.doorSplineDolly.CameraPosition = 1f;
string doorType = activeDoor != null ? activeDoor.type : "";
yield return new WaitForSeconds(2.0f);
// 4. Safely drop the camera's priority
if (activeCam != null)
{
activeCam.Priority = inactivePriority;
}
// The camera is now inside the room. Let's check what kind of door it was!
if (activeDoor.type == "LIFE")
// 5. Trigger the appropriate level logic
if (doorType == "LIFE")
{
Debug.Log("Safe door chosen! Advancing to the next level.");
GlobalStateManager.Instance.SetLevelCompleted();
}
else if (activeDoor.type == "DEATH")
else if (doorType == "DEATH")
{
Debug.Log("Wrong door! The player has met a grim fate.");
// Add your death screen or level restart logic here!
// For example: GlobalStateManager.Instance.TriggerGameOver();
Debug.Log("Wrong door! Teleporting back to start.");
// Insert your death/teleport logic here
}
else
{
Debug.LogWarning($"Door type '{activeDoor.type}' is not recognised for level transitions.");
}
}
private void ReturnToMainCamera()
{
focusCameraA.Priority = inactivePriority;
focusCameraB.Priority = inactivePriority;
focusCameraA.Follow = null; focusCameraA.LookAt = null;
focusCameraB.Follow = null; focusCameraB.LookAt = null;
currentInteractableTransform = null;
activeDynamicTarget = null;
currentGuardManager = null;
currentDoorManager = null;
if (talkButton != null) talkButton.gameObject.SetActive(false);
if (doorButton != null) doorButton.gameObject.SetActive(false);
}
private void UnsetAll()
{
foreach (var doorManager in LevelLoader.Instance.Doors)
{
doorManager.isfocussed = 0;
}
foreach (var doorManager in LevelLoader.Instance.Guards)
{
doorManager.isfocussed = 0;
Debug.LogWarning($"Door type '{doorType}' is not recognised.");
}
// 6. Play the intro sweep for the newly generated room or restart
yield return StartCoroutine(IntroSequenceRoutine());
}
private void ResetCameraPositions()
{
ReturnToMainCamera();
    private void HandleEdgeNudge()
    {
        Vector2 mousePos = Mouse.current.position.ReadValue();
        float yawInput = 0f;
currentFocusOffsetX = 0f;
currentYaw = 0f;
if (explorationCamera != null)
{
explorationCamera.transform.rotation = startingRotation;
}
}
        if (mousePos.x < edgeThickness) yawInput = -1f;
        else if (mousePos.x > Screen.width - edgeThickness) yawInput = 1f;
        bool isFocused = focusCameraA.Priority >= activePriority || focusCameraB.Priority >= activePriority;
        if (yawInput != 0f)
        {
            if (isFocused && currentInteractableTransform != null && activeDynamicTarget != null)
            {
                currentFocusOffsetX += yawInput * focusNudgeSpeed * Time.deltaTime;
                currentFocusOffsetX = Mathf.Clamp(currentFocusOffsetX, -maxFocusOffset, maxFocusOffset);
                activeDynamicTarget.position = currentInteractableTransform.position
                    + (mainUnityCamera.transform.right * currentFocusOffsetX);
            }
            else if (!isFocused && explorationCamera != null)
            {
                currentYaw += yawInput * nudgeSpeed * Time.deltaTime;
                currentYaw = Mathf.Clamp(currentYaw, -maxNudgeAngle, maxNudgeAngle);
               
                Quaternion yawRotation = Quaternion.AngleAxis(currentYaw, Vector3.up);
                explorationCamera.transform.rotation = startingRotation * yawRotation;
            }
        }
    }
    private void HandleHover()
    {
        Vector2 mousePos = Mouse.current.position.ReadValue();
        Ray ray = mainUnityCamera.ScreenPointToRay(mousePos);
       
        if (Physics.Raycast(ray, out RaycastHit hit, 100f, interactableLayer))
        {
            Renderer hitRenderer = hit.transform.GetComponentInChildren<Renderer>();
           
            if (hitRenderer != null && hitRenderer != currentlyHoveredRenderer)
            {
                RemoveHighlight();
                currentlyHoveredRenderer = hitRenderer;
                if (currentlyHoveredRenderer is SpriteRenderer sprite)
                {
                    originalColour = sprite.color;
                    sprite.color = highlightColour;
                }
                else
                {
                    originalColour = currentlyHoveredRenderer.material.color;
                    currentlyHoveredRenderer.material.color = highlightColour;
                }
            }
        }
        else
        {
            RemoveHighlight();
        }
    }
    private void RemoveHighlight()
    {
        if (currentlyHoveredRenderer != null)
        {
            if (currentlyHoveredRenderer is SpriteRenderer sprite)
            {
                sprite.color = originalColour;
            }
            else
            {
                currentlyHoveredRenderer.material.color = originalColour;
            }
            currentlyHoveredRenderer = null;
        }
    }
    private void HandleInteractionClick()
    {
        Vector2 mousePos = Mouse.current.position.ReadValue();
        Ray ray = mainUnityCamera.ScreenPointToRay(mousePos);
       
        if (Physics.Raycast(ray, out RaycastHit hit, 100f, interactableLayer))
        {
            currentInteractableTransform = hit.transform;
            currentFocusOffsetX = 0f;
           
            CinemachineCamera nextCam = useCameraA ? focusCameraA : focusCameraB;
            CinemachineCamera oldCam  = useCameraA ? focusCameraB : focusCameraA;
            Transform nextTarget      = useCameraA ? dynamicFocusTargetA : dynamicFocusTargetB;
           
            nextTarget.position = currentInteractableTransform.position;
            nextCam.Follow = currentInteractableTransform;
            nextCam.LookAt = nextTarget;
           
            nextCam.Priority = activePriority;
            oldCam.Priority = inactivePriority;
           
            activeDynamicTarget = nextTarget;
            useCameraA = !useCameraA;
            GuardManager guard = hit.transform.GetComponent<GuardManager>();
            DoorManager door = hit.transform.GetComponent<DoorManager>();
            if (talkButton != null) talkButton.gameObject.SetActive(false);
            if (doorButton != null) doorButton.gameObject.SetActive(false);
            if (guard != null)
            {
TutorialManager.Instance.LogAction("TAP");
                currentGuardManager = guard;
                if (talkButton != null) talkButton.gameObject.SetActive(true);
            }
            else if (door != null)
            {
TutorialManager.Instance.LogAction("TAP");
                currentDoorManager = door;
                if (doorButton != null) doorButton.gameObject.SetActive(true);
            }
        }
        else
        {
            ReturnToMainCamera();
        }
    }
    private void OnTalkButtonClicked()
    {
        if (currentGuardManager != null)
        {
            DialogManager.Instance.StartDialog(currentGuardManager);
            talkButton.gameObject.SetActive(false);
        }
    }
    private void OnDoorButtonClicked()
    {
        if (currentDoorManager != null && currentDoorManager.doorCamera != null && currentDoorManager.doorSplineDolly != null)
        {
            doorButton.gameObject.SetActive(false);
            StartCoroutine(DoorSequenceRoutine(currentDoorManager));
        }
        else
        {
            Debug.LogError("The DoorManager is missing its Camera or Spline Dolly references!");
        }
    }
    private void ReturnToMainCamera()
    {
        focusCameraA.Priority = inactivePriority;
        focusCameraB.Priority = inactivePriority;
        if (introCamera != null) introCamera.Priority = inactivePriority;
       
        focusCameraA.Follow = null; focusCameraA.LookAt = null;
        focusCameraB.Follow = null; focusCameraB.LookAt = null;
       
        currentInteractableTransform = null;
        activeDynamicTarget = null;
        currentGuardManager = null;
        currentDoorManager = null;
        if (talkButton != null) talkButton.gameObject.SetActive(false);
        if (doorButton != null) doorButton.gameObject.SetActive(false);
    }
    private void ResetCameraPositions()
    {
        ReturnToMainCamera();
        currentFocusOffsetX = 0f;
        currentYaw = 0f;
       
        if (explorationCamera != null)
        {
            explorationCamera.transform.rotation = startingRotation;
        }
    }
}
+3
View File
@@ -25,6 +25,9 @@ public class DoorManager : MonoBehaviour, IDescribable
public CinemachineCamera doorCamera;
public CinemachineSplineDolly doorSplineDolly;
public CinemachineCamera deathCamera;
public CinemachineSplineDolly deathSplineDolly;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()