app.hypergames.hypersdk 1.10.0 → 1.11.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/Editor/Scripts/Setup/HyperSDKInstaller.cs +42 -0
- package/Editor/Scripts/Tools/HyperGameModeMenu.cs +27 -7
- package/Runtime/Internal/AssemblyInfo.cs +1 -0
- package/Runtime/Internal/Bootstrap/HyperLoader.cs +186 -8
- package/Runtime/Internal/Core/HyperRuntime.cs +82 -0
- package/Runtime/Internal/Core/HyperRuntimeHost.cs +6 -0
- package/Runtime/Internal/Data/URLData.cs +18 -1
- package/Runtime/Internal/Managers/BackendManager.cs +281 -24
- package/Runtime/Internal/Managers/DataManager.cs +207 -21
- package/Runtime/Internal/Managers/GameManager.cs +365 -17
- package/Runtime/Internal/Managers/ReplayManager.cs +117 -0
- package/Runtime/Internal/Managers/ReplayManager.cs.meta +11 -0
- package/Runtime/Internal/Managers/TimeManager.cs +54 -12
- package/Runtime/Internal/Replay/ReplayActivityRecorder.cs +182 -0
- package/Runtime/Internal/Replay/ReplayActivityRecorder.cs.meta +2 -0
- package/Runtime/Internal/Replay/ReplaySessionState.cs +181 -0
- package/Runtime/Internal/Replay/ReplaySessionState.cs.meta +2 -0
- package/Runtime/Internal/Replay.meta +8 -0
- package/Runtime/Internal/ScriptableObjects/HyperSDKSettings.cs +5 -0
- package/Runtime/Internal/UI/Animation/LoadingTextAnimation.cs +15 -1
- package/Runtime/Internal/UI/Components/ControlBar.cs +25 -2
- package/Runtime/Internal/UI/Components/PauseButton.cs +4 -1
- package/Runtime/Internal/UI/Components/ReplayController.cs +527 -0
- package/Runtime/Internal/UI/Components/ReplayController.cs.meta +2 -0
- package/Runtime/Internal/UI/Components/ReplayMarkerPulse.cs +89 -0
- package/Runtime/Internal/UI/Components/ReplayMarkerPulse.cs.meta +2 -0
- package/Runtime/Internal/UI/Components/ReplayPresentationCanvas.cs +183 -0
- package/Runtime/Internal/UI/Components/ReplayPresentationCanvas.cs.meta +2 -0
- package/Runtime/Internal/UI/Modals/LoadingFailedModal.cs +12 -0
- package/Runtime/Internal/UI/Modals/ReplayOverModal.cs +61 -0
- package/Runtime/Internal/UI/Modals/ReplayOverModal.cs.meta +2 -0
- package/Runtime/Internal/UI/Modals/StartingInstructionModal.cs +38 -29
- package/Runtime/Public/AssemblyInfo.cs +3 -0
- package/Runtime/Public/AssemblyInfo.cs.meta +2 -0
- package/Runtime/Public/Core/HyperSDK.cs +305 -109
- package/Runtime/Public/Hyper.asmdef +2 -1
- package/Runtime/Public/Replay/ReplayPlaybackEngine.cs +555 -0
- package/Runtime/Public/Replay/ReplayPlaybackEngine.cs.meta +2 -0
- package/Runtime/Public/Replay.meta +8 -0
- package/Runtime/Resources/Fonts/Nunito/Nunito-Light SDF.asset +528 -521
- package/Runtime/Resources/Materials/HyperReplayScanlines.preset +340 -0
- package/Runtime/Resources/Materials/HyperReplayScanlines.preset.meta +8 -0
- package/Runtime/Resources/Materials/ReplayScanlineOverlay.mat +55 -0
- package/Runtime/Resources/Materials/ReplayScanlineOverlay.mat.meta +8 -0
- package/Runtime/Resources/Shaders/ReplayScanlineOverlay.shader +150 -0
- package/Runtime/Resources/Shaders/ReplayScanlineOverlay.shader.meta +10 -0
- package/Runtime/Resources/Sprites/Replays/Fallback avatar.png +0 -0
- package/Runtime/Resources/Sprites/Replays/Fallback avatar.png.meta +156 -0
- package/Runtime/Resources/Sprites/Replays/Recording.png +0 -0
- package/Runtime/Resources/Sprites/Replays/Recording.png.meta +156 -0
- package/Runtime/Resources/Sprites/Replays/Replay frame.png +0 -0
- package/Runtime/Resources/Sprites/Replays/Replay frame.png.meta +156 -0
- package/Runtime/Resources/Sprites/Replays/Replay modal icon.png +0 -0
- package/Runtime/Resources/Sprites/Replays/Replay modal icon.png.meta +156 -0
- package/Runtime/Resources/Sprites/Replays.meta +8 -0
- package/Runtime/Resources/UIPrefabs/ControlBar.prefab +169 -2
- package/Runtime/Resources/UIPrefabs/GamePausedModal_Battle.prefab +1 -1
- package/Runtime/Resources/UIPrefabs/ReplayController.prefab +1269 -0
- package/Runtime/Resources/UIPrefabs/ReplayController.prefab.meta +7 -0
- package/Runtime/Resources/UIPrefabs/ReplayInputBlocker.prefab +90 -0
- package/Runtime/Resources/UIPrefabs/ReplayInputBlocker.prefab.meta +7 -0
- package/Runtime/Resources/UIPrefabs/ReplayOverModal.prefab +958 -0
- package/Runtime/Resources/UIPrefabs/ReplayOverModal.prefab.meta +7 -0
- package/Runtime/Resources/UIPrefabs/ReplaySeekOverlay.prefab +189 -0
- package/Runtime/Resources/UIPrefabs/ReplaySeekOverlay.prefab.meta +7 -0
- package/Runtime/Resources/UIPrefabs/SnackBar.prefab +2 -2
- package/Runtime/Shared/AssemblyInfo.cs +5 -0
- package/Runtime/Shared/AssemblyInfo.cs.meta +11 -0
- package/Runtime/Shared/DTOs/Enums.cs +8 -3
- package/Runtime/Shared/DTOs/Score/ScoreSnapshot.cs +13 -1
- package/Runtime/Shared/Replay/IReplayPlaybackEngine.cs +37 -0
- package/Runtime/Shared/Replay/IReplayPlaybackEngine.cs.meta +11 -0
- package/Runtime/Shared/Replay.meta +8 -0
- package/Samples~/LaneRunner/LaneRunnerSample.unity +1603 -0
- package/Samples~/LaneRunner/LaneRunnerSample.unity.meta +7 -0
- package/Samples~/LaneRunner/Materials/DoubleScore.mat +86 -0
- package/Samples~/LaneRunner/Materials/DoubleScore.mat.meta +8 -0
- package/Samples~/LaneRunner/Materials/Ground.mat +84 -0
- package/Samples~/LaneRunner/Materials/Ground.mat.meta +8 -0
- package/Samples~/LaneRunner/Materials/Lane.mat +84 -0
- package/Samples~/LaneRunner/Materials/Lane.mat.meta +8 -0
- package/Samples~/LaneRunner/Materials/LaneMarker.mat +84 -0
- package/Samples~/LaneRunner/Materials/LaneMarker.mat.meta +8 -0
- package/Samples~/LaneRunner/Materials/Obstacle.mat +84 -0
- package/Samples~/LaneRunner/Materials/Obstacle.mat.meta +8 -0
- package/Samples~/LaneRunner/Materials/Player.mat +84 -0
- package/Samples~/LaneRunner/Materials/Player.mat.meta +8 -0
- package/Samples~/LaneRunner/Materials.meta +8 -0
- package/Samples~/LaneRunner/Prefabs/DoubleScorePickup.prefab +152 -0
- package/Samples~/LaneRunner/Prefabs/DoubleScorePickup.prefab.meta +7 -0
- package/Samples~/LaneRunner/Prefabs/Obstacle.prefab +152 -0
- package/Samples~/LaneRunner/Prefabs/Obstacle.prefab.meta +7 -0
- package/Samples~/LaneRunner/Prefabs.meta +8 -0
- package/Samples~/LaneRunner/README.md +35 -0
- package/Samples~/LaneRunner/README.md.meta +7 -0
- package/Samples~/LaneRunner/Scripts/Gameplay/LaneRunnerCommand.cs +9 -0
- package/Samples~/LaneRunner/Scripts/Gameplay/LaneRunnerCommand.cs.meta +2 -0
- package/Samples~/LaneRunner/Scripts/Gameplay/LaneRunnerGame.cs +93 -0
- package/Samples~/LaneRunner/Scripts/Gameplay/LaneRunnerGame.cs.meta +2 -0
- package/Samples~/LaneRunner/Scripts/Gameplay/LaneRunnerPlayer.cs +155 -0
- package/Samples~/LaneRunner/Scripts/Gameplay/LaneRunnerPlayer.cs.meta +2 -0
- package/Samples~/LaneRunner/Scripts/Gameplay/LaneRunnerSpawner.cs +110 -0
- package/Samples~/LaneRunner/Scripts/Gameplay/LaneRunnerSpawner.cs.meta +2 -0
- package/Samples~/LaneRunner/Scripts/Gameplay/LaneRunnerTrackItem.cs +41 -0
- package/Samples~/LaneRunner/Scripts/Gameplay/LaneRunnerTrackItem.cs.meta +2 -0
- package/Samples~/LaneRunner/Scripts/Gameplay.meta +8 -0
- package/Samples~/LaneRunner/Scripts/Hyper/LaneRunnerReplayAdapter.cs +62 -0
- package/Samples~/LaneRunner/Scripts/Hyper/LaneRunnerReplayAdapter.cs.meta +2 -0
- package/Samples~/LaneRunner/Scripts/Hyper/LaneRunnerTournamentAdapter.cs +64 -0
- package/Samples~/LaneRunner/Scripts/Hyper/LaneRunnerTournamentAdapter.cs.meta +2 -0
- package/Samples~/LaneRunner/Scripts/Hyper.meta +8 -0
- package/Samples~/LaneRunner/Scripts.meta +8 -0
- package/Tests.meta +8 -0
- package/package.json +8 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!1 &4122494009787179883
|
|
4
|
+
GameObject:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
serializedVersion: 6
|
|
10
|
+
m_Component:
|
|
11
|
+
- component: {fileID: 6433609908091535661}
|
|
12
|
+
- component: {fileID: 7121910225939348887}
|
|
13
|
+
- component: {fileID: 7832153223912747726}
|
|
14
|
+
- component: {fileID: 245166456015105769}
|
|
15
|
+
- component: {fileID: 2803258236501787411}
|
|
16
|
+
- component: {fileID: 3724547471223867592}
|
|
17
|
+
m_Layer: 0
|
|
18
|
+
m_Name: DoubleScorePickup
|
|
19
|
+
m_TagString: Untagged
|
|
20
|
+
m_Icon: {fileID: 0}
|
|
21
|
+
m_NavMeshLayer: 0
|
|
22
|
+
m_StaticEditorFlags: 0
|
|
23
|
+
m_IsActive: 1
|
|
24
|
+
--- !u!4 &6433609908091535661
|
|
25
|
+
Transform:
|
|
26
|
+
m_ObjectHideFlags: 0
|
|
27
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
28
|
+
m_PrefabInstance: {fileID: 0}
|
|
29
|
+
m_PrefabAsset: {fileID: 0}
|
|
30
|
+
m_GameObject: {fileID: 4122494009787179883}
|
|
31
|
+
serializedVersion: 2
|
|
32
|
+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
33
|
+
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
34
|
+
m_LocalScale: {x: 1.05, y: 1.05, z: 1.05}
|
|
35
|
+
m_ConstrainProportionsScale: 0
|
|
36
|
+
m_Children: []
|
|
37
|
+
m_Father: {fileID: 0}
|
|
38
|
+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
39
|
+
--- !u!33 &7121910225939348887
|
|
40
|
+
MeshFilter:
|
|
41
|
+
m_ObjectHideFlags: 0
|
|
42
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
43
|
+
m_PrefabInstance: {fileID: 0}
|
|
44
|
+
m_PrefabAsset: {fileID: 0}
|
|
45
|
+
m_GameObject: {fileID: 4122494009787179883}
|
|
46
|
+
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
|
|
47
|
+
--- !u!135 &7832153223912747726
|
|
48
|
+
SphereCollider:
|
|
49
|
+
m_ObjectHideFlags: 0
|
|
50
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
51
|
+
m_PrefabInstance: {fileID: 0}
|
|
52
|
+
m_PrefabAsset: {fileID: 0}
|
|
53
|
+
m_GameObject: {fileID: 4122494009787179883}
|
|
54
|
+
m_Material: {fileID: 0}
|
|
55
|
+
m_IncludeLayers:
|
|
56
|
+
serializedVersion: 2
|
|
57
|
+
m_Bits: 0
|
|
58
|
+
m_ExcludeLayers:
|
|
59
|
+
serializedVersion: 2
|
|
60
|
+
m_Bits: 0
|
|
61
|
+
m_LayerOverridePriority: 0
|
|
62
|
+
m_IsTrigger: 1
|
|
63
|
+
m_ProvidesContacts: 0
|
|
64
|
+
m_Enabled: 1
|
|
65
|
+
serializedVersion: 3
|
|
66
|
+
m_Radius: 0.5
|
|
67
|
+
m_Center: {x: 0, y: 0, z: 0}
|
|
68
|
+
--- !u!23 &245166456015105769
|
|
69
|
+
MeshRenderer:
|
|
70
|
+
m_ObjectHideFlags: 0
|
|
71
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
72
|
+
m_PrefabInstance: {fileID: 0}
|
|
73
|
+
m_PrefabAsset: {fileID: 0}
|
|
74
|
+
m_GameObject: {fileID: 4122494009787179883}
|
|
75
|
+
m_Enabled: 1
|
|
76
|
+
m_CastShadows: 1
|
|
77
|
+
m_ReceiveShadows: 1
|
|
78
|
+
m_DynamicOccludee: 1
|
|
79
|
+
m_StaticShadowCaster: 0
|
|
80
|
+
m_MotionVectors: 1
|
|
81
|
+
m_LightProbeUsage: 1
|
|
82
|
+
m_ReflectionProbeUsage: 1
|
|
83
|
+
m_RayTracingMode: 2
|
|
84
|
+
m_RayTraceProcedural: 0
|
|
85
|
+
m_RayTracingAccelStructBuildFlagsOverride: 0
|
|
86
|
+
m_RayTracingAccelStructBuildFlags: 1
|
|
87
|
+
m_SmallMeshCulling: 1
|
|
88
|
+
m_RenderingLayerMask: 1
|
|
89
|
+
m_RendererPriority: 0
|
|
90
|
+
m_Materials:
|
|
91
|
+
- {fileID: 2100000, guid: 5477d0aea0bf80a48be0dbf9edbae95a, type: 2}
|
|
92
|
+
m_StaticBatchInfo:
|
|
93
|
+
firstSubMesh: 0
|
|
94
|
+
subMeshCount: 0
|
|
95
|
+
m_StaticBatchRoot: {fileID: 0}
|
|
96
|
+
m_ProbeAnchor: {fileID: 0}
|
|
97
|
+
m_LightProbeVolumeOverride: {fileID: 0}
|
|
98
|
+
m_ScaleInLightmap: 1
|
|
99
|
+
m_ReceiveGI: 1
|
|
100
|
+
m_PreserveUVs: 1
|
|
101
|
+
m_IgnoreNormalsForChartDetection: 0
|
|
102
|
+
m_ImportantGI: 0
|
|
103
|
+
m_StitchLightmapSeams: 1
|
|
104
|
+
m_SelectedEditorRenderState: 3
|
|
105
|
+
m_MinimumChartSize: 4
|
|
106
|
+
m_AutoUVMaxDistance: 0.5
|
|
107
|
+
m_AutoUVMaxAngle: 89
|
|
108
|
+
m_LightmapParameters: {fileID: 0}
|
|
109
|
+
m_SortingLayerID: 0
|
|
110
|
+
m_SortingLayer: 0
|
|
111
|
+
m_SortingOrder: 0
|
|
112
|
+
m_AdditionalVertexStreams: {fileID: 0}
|
|
113
|
+
--- !u!54 &2803258236501787411
|
|
114
|
+
Rigidbody:
|
|
115
|
+
m_ObjectHideFlags: 0
|
|
116
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
117
|
+
m_PrefabInstance: {fileID: 0}
|
|
118
|
+
m_PrefabAsset: {fileID: 0}
|
|
119
|
+
m_GameObject: {fileID: 4122494009787179883}
|
|
120
|
+
serializedVersion: 4
|
|
121
|
+
m_Mass: 1
|
|
122
|
+
m_Drag: 0
|
|
123
|
+
m_AngularDrag: 0.05
|
|
124
|
+
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
|
125
|
+
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
|
126
|
+
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
127
|
+
m_IncludeLayers:
|
|
128
|
+
serializedVersion: 2
|
|
129
|
+
m_Bits: 0
|
|
130
|
+
m_ExcludeLayers:
|
|
131
|
+
serializedVersion: 2
|
|
132
|
+
m_Bits: 0
|
|
133
|
+
m_ImplicitCom: 1
|
|
134
|
+
m_ImplicitTensor: 1
|
|
135
|
+
m_UseGravity: 0
|
|
136
|
+
m_IsKinematic: 1
|
|
137
|
+
m_Interpolate: 0
|
|
138
|
+
m_Constraints: 0
|
|
139
|
+
m_CollisionDetection: 0
|
|
140
|
+
--- !u!114 &3724547471223867592
|
|
141
|
+
MonoBehaviour:
|
|
142
|
+
m_ObjectHideFlags: 0
|
|
143
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
144
|
+
m_PrefabInstance: {fileID: 0}
|
|
145
|
+
m_PrefabAsset: {fileID: 0}
|
|
146
|
+
m_GameObject: {fileID: 4122494009787179883}
|
|
147
|
+
m_Enabled: 1
|
|
148
|
+
m_EditorHideFlags: 0
|
|
149
|
+
m_Script: {fileID: 11500000, guid: d30ecc4be65668940a5990199de8c899, type: 3}
|
|
150
|
+
m_Name:
|
|
151
|
+
m_EditorClassIdentifier:
|
|
152
|
+
doubleScorePickup: 1
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!1 &6430252537693784949
|
|
4
|
+
GameObject:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
serializedVersion: 6
|
|
10
|
+
m_Component:
|
|
11
|
+
- component: {fileID: 2742232547165175125}
|
|
12
|
+
- component: {fileID: 4471148443040927750}
|
|
13
|
+
- component: {fileID: 705868622986271356}
|
|
14
|
+
- component: {fileID: 597113936367337497}
|
|
15
|
+
- component: {fileID: 8610291193526034833}
|
|
16
|
+
- component: {fileID: 6935381596637914183}
|
|
17
|
+
m_Layer: 0
|
|
18
|
+
m_Name: Obstacle
|
|
19
|
+
m_TagString: Untagged
|
|
20
|
+
m_Icon: {fileID: 0}
|
|
21
|
+
m_NavMeshLayer: 0
|
|
22
|
+
m_StaticEditorFlags: 0
|
|
23
|
+
m_IsActive: 1
|
|
24
|
+
--- !u!4 &2742232547165175125
|
|
25
|
+
Transform:
|
|
26
|
+
m_ObjectHideFlags: 0
|
|
27
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
28
|
+
m_PrefabInstance: {fileID: 0}
|
|
29
|
+
m_PrefabAsset: {fileID: 0}
|
|
30
|
+
m_GameObject: {fileID: 6430252537693784949}
|
|
31
|
+
serializedVersion: 2
|
|
32
|
+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
33
|
+
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
34
|
+
m_LocalScale: {x: 1.35, y: 1.5, z: 1.55}
|
|
35
|
+
m_ConstrainProportionsScale: 0
|
|
36
|
+
m_Children: []
|
|
37
|
+
m_Father: {fileID: 0}
|
|
38
|
+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
39
|
+
--- !u!33 &4471148443040927750
|
|
40
|
+
MeshFilter:
|
|
41
|
+
m_ObjectHideFlags: 0
|
|
42
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
43
|
+
m_PrefabInstance: {fileID: 0}
|
|
44
|
+
m_PrefabAsset: {fileID: 0}
|
|
45
|
+
m_GameObject: {fileID: 6430252537693784949}
|
|
46
|
+
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
|
47
|
+
--- !u!65 &705868622986271356
|
|
48
|
+
BoxCollider:
|
|
49
|
+
m_ObjectHideFlags: 0
|
|
50
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
51
|
+
m_PrefabInstance: {fileID: 0}
|
|
52
|
+
m_PrefabAsset: {fileID: 0}
|
|
53
|
+
m_GameObject: {fileID: 6430252537693784949}
|
|
54
|
+
m_Material: {fileID: 0}
|
|
55
|
+
m_IncludeLayers:
|
|
56
|
+
serializedVersion: 2
|
|
57
|
+
m_Bits: 0
|
|
58
|
+
m_ExcludeLayers:
|
|
59
|
+
serializedVersion: 2
|
|
60
|
+
m_Bits: 0
|
|
61
|
+
m_LayerOverridePriority: 0
|
|
62
|
+
m_IsTrigger: 1
|
|
63
|
+
m_ProvidesContacts: 0
|
|
64
|
+
m_Enabled: 1
|
|
65
|
+
serializedVersion: 3
|
|
66
|
+
m_Size: {x: 1, y: 1, z: 1}
|
|
67
|
+
m_Center: {x: 0, y: 0, z: 0}
|
|
68
|
+
--- !u!23 &597113936367337497
|
|
69
|
+
MeshRenderer:
|
|
70
|
+
m_ObjectHideFlags: 0
|
|
71
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
72
|
+
m_PrefabInstance: {fileID: 0}
|
|
73
|
+
m_PrefabAsset: {fileID: 0}
|
|
74
|
+
m_GameObject: {fileID: 6430252537693784949}
|
|
75
|
+
m_Enabled: 1
|
|
76
|
+
m_CastShadows: 1
|
|
77
|
+
m_ReceiveShadows: 1
|
|
78
|
+
m_DynamicOccludee: 1
|
|
79
|
+
m_StaticShadowCaster: 0
|
|
80
|
+
m_MotionVectors: 1
|
|
81
|
+
m_LightProbeUsage: 1
|
|
82
|
+
m_ReflectionProbeUsage: 1
|
|
83
|
+
m_RayTracingMode: 2
|
|
84
|
+
m_RayTraceProcedural: 0
|
|
85
|
+
m_RayTracingAccelStructBuildFlagsOverride: 0
|
|
86
|
+
m_RayTracingAccelStructBuildFlags: 1
|
|
87
|
+
m_SmallMeshCulling: 1
|
|
88
|
+
m_RenderingLayerMask: 1
|
|
89
|
+
m_RendererPriority: 0
|
|
90
|
+
m_Materials:
|
|
91
|
+
- {fileID: 2100000, guid: 0d5a2abe57852794ca0154f6270b5e8e, type: 2}
|
|
92
|
+
m_StaticBatchInfo:
|
|
93
|
+
firstSubMesh: 0
|
|
94
|
+
subMeshCount: 0
|
|
95
|
+
m_StaticBatchRoot: {fileID: 0}
|
|
96
|
+
m_ProbeAnchor: {fileID: 0}
|
|
97
|
+
m_LightProbeVolumeOverride: {fileID: 0}
|
|
98
|
+
m_ScaleInLightmap: 1
|
|
99
|
+
m_ReceiveGI: 1
|
|
100
|
+
m_PreserveUVs: 1
|
|
101
|
+
m_IgnoreNormalsForChartDetection: 0
|
|
102
|
+
m_ImportantGI: 0
|
|
103
|
+
m_StitchLightmapSeams: 1
|
|
104
|
+
m_SelectedEditorRenderState: 3
|
|
105
|
+
m_MinimumChartSize: 4
|
|
106
|
+
m_AutoUVMaxDistance: 0.5
|
|
107
|
+
m_AutoUVMaxAngle: 89
|
|
108
|
+
m_LightmapParameters: {fileID: 0}
|
|
109
|
+
m_SortingLayerID: 0
|
|
110
|
+
m_SortingLayer: 0
|
|
111
|
+
m_SortingOrder: 0
|
|
112
|
+
m_AdditionalVertexStreams: {fileID: 0}
|
|
113
|
+
--- !u!54 &8610291193526034833
|
|
114
|
+
Rigidbody:
|
|
115
|
+
m_ObjectHideFlags: 0
|
|
116
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
117
|
+
m_PrefabInstance: {fileID: 0}
|
|
118
|
+
m_PrefabAsset: {fileID: 0}
|
|
119
|
+
m_GameObject: {fileID: 6430252537693784949}
|
|
120
|
+
serializedVersion: 4
|
|
121
|
+
m_Mass: 1
|
|
122
|
+
m_Drag: 0
|
|
123
|
+
m_AngularDrag: 0.05
|
|
124
|
+
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
|
125
|
+
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
|
126
|
+
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
127
|
+
m_IncludeLayers:
|
|
128
|
+
serializedVersion: 2
|
|
129
|
+
m_Bits: 0
|
|
130
|
+
m_ExcludeLayers:
|
|
131
|
+
serializedVersion: 2
|
|
132
|
+
m_Bits: 0
|
|
133
|
+
m_ImplicitCom: 1
|
|
134
|
+
m_ImplicitTensor: 1
|
|
135
|
+
m_UseGravity: 0
|
|
136
|
+
m_IsKinematic: 1
|
|
137
|
+
m_Interpolate: 0
|
|
138
|
+
m_Constraints: 0
|
|
139
|
+
m_CollisionDetection: 0
|
|
140
|
+
--- !u!114 &6935381596637914183
|
|
141
|
+
MonoBehaviour:
|
|
142
|
+
m_ObjectHideFlags: 0
|
|
143
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
144
|
+
m_PrefabInstance: {fileID: 0}
|
|
145
|
+
m_PrefabAsset: {fileID: 0}
|
|
146
|
+
m_GameObject: {fileID: 6430252537693784949}
|
|
147
|
+
m_Enabled: 1
|
|
148
|
+
m_EditorHideFlags: 0
|
|
149
|
+
m_Script: {fileID: 11500000, guid: d30ecc4be65668940a5990199de8c899, type: 3}
|
|
150
|
+
m_Name:
|
|
151
|
+
m_EditorClassIdentifier:
|
|
152
|
+
doubleScorePickup: 0
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Lane Runner Sample
|
|
2
|
+
|
|
3
|
+
Lane Runner is a small, scene-authored Hyper game showing score reporting,
|
|
4
|
+
deterministic spawning, a timed score multiplier, and replay integration.
|
|
5
|
+
|
|
6
|
+
## Play
|
|
7
|
+
|
|
8
|
+
- Use `A` / `D` or the arrow keys to change lanes.
|
|
9
|
+
- Press `Space` or swipe up to jump.
|
|
10
|
+
- Avoid red obstacles.
|
|
11
|
+
- Collect the yellow pickup for five seconds of double score.
|
|
12
|
+
|
|
13
|
+
Assign `LaneRunnerSample` as the Game and Practice scene in Hyper Game Content
|
|
14
|
+
Config, then use Hyper's Editor game-mode menu to run Practice, Battle, or Replay.
|
|
15
|
+
Battle sessions record to `hyper-replay.ndjson` in `Application.persistentDataPath`.
|
|
16
|
+
|
|
17
|
+
## Integration structure
|
|
18
|
+
|
|
19
|
+
- `LaneRunnerGame` owns rules, score, speed, and power-up state.
|
|
20
|
+
- `LaneRunnerPlayer` owns physical input and applies commands in `FixedUpdate`.
|
|
21
|
+
- `LaneRunnerSpawner` creates deterministic rows using `HyperRandom`.
|
|
22
|
+
- `LaneRunnerTournamentAdapter` connects score, power-ups, and lifecycle to HyperSDK.
|
|
23
|
+
- `LaneRunnerReplayAdapter` records accepted commands and injects replay commands
|
|
24
|
+
through the same player path.
|
|
25
|
+
|
|
26
|
+
The replay adapter does not move or jump the player directly. It records commands
|
|
27
|
+
after the player accepts them and routes playback back through `QueueCommand`:
|
|
28
|
+
|
|
29
|
+
```csharp
|
|
30
|
+
HyperSDK.Data.RecordActivity("Jump");
|
|
31
|
+
HyperSDK.Replay.OnAction += HandleReplayAction;
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`RecordActivity` records only during active Battle gameplay. The SDK owns replay
|
|
35
|
+
timestamps, file loading, scheduling, pause handling, progress, and completion.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace HyperSamples.LaneRunner
|
|
5
|
+
{
|
|
6
|
+
public sealed class LaneRunnerGame : MonoBehaviour
|
|
7
|
+
{
|
|
8
|
+
[SerializeField] private LaneRunnerPlayer player;
|
|
9
|
+
[SerializeField] private LaneRunnerSpawner spawner;
|
|
10
|
+
[SerializeField] private float startingSpeed = 7f;
|
|
11
|
+
[SerializeField] private float maximumSpeed = 15f;
|
|
12
|
+
[SerializeField] private float accelerationPerSecond = 0.12f;
|
|
13
|
+
[SerializeField] private float scorePerMeter = 10f;
|
|
14
|
+
[SerializeField] private float doubleScoreDuration = 5f;
|
|
15
|
+
|
|
16
|
+
public event Action<int> ScoreChanged;
|
|
17
|
+
public event Action<bool> DoubleScoreChanged;
|
|
18
|
+
public event Action GameOverRequested;
|
|
19
|
+
|
|
20
|
+
public bool IsRunning { get; private set; }
|
|
21
|
+
public int Score { get; private set; }
|
|
22
|
+
public float CurrentSpeed { get; private set; }
|
|
23
|
+
|
|
24
|
+
private float elapsed;
|
|
25
|
+
private float preciseScore;
|
|
26
|
+
private float doubleScoreRemaining;
|
|
27
|
+
|
|
28
|
+
private void FixedUpdate()
|
|
29
|
+
{
|
|
30
|
+
if (!IsRunning) return;
|
|
31
|
+
|
|
32
|
+
elapsed += Time.fixedDeltaTime;
|
|
33
|
+
CurrentSpeed = Mathf.Min(maximumSpeed,
|
|
34
|
+
startingSpeed + accelerationPerSecond * elapsed);
|
|
35
|
+
|
|
36
|
+
float multiplier = doubleScoreRemaining > 0f ? 2f : 1f;
|
|
37
|
+
preciseScore += CurrentSpeed * Time.fixedDeltaTime * scorePerMeter * multiplier;
|
|
38
|
+
int nextScore = Mathf.FloorToInt(preciseScore);
|
|
39
|
+
if (nextScore != Score)
|
|
40
|
+
{
|
|
41
|
+
Score = nextScore;
|
|
42
|
+
ScoreChanged?.Invoke(Score);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (doubleScoreRemaining > 0f)
|
|
46
|
+
{
|
|
47
|
+
doubleScoreRemaining -= Time.fixedDeltaTime;
|
|
48
|
+
if (doubleScoreRemaining <= 0f)
|
|
49
|
+
DoubleScoreChanged?.Invoke(false);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
spawner.Tick(CurrentSpeed, Time.fixedDeltaTime);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public void Begin(bool allowPhysicalInput)
|
|
56
|
+
{
|
|
57
|
+
elapsed = 0f;
|
|
58
|
+
preciseScore = 0f;
|
|
59
|
+
doubleScoreRemaining = 0f;
|
|
60
|
+
Score = 0;
|
|
61
|
+
CurrentSpeed = startingSpeed;
|
|
62
|
+
IsRunning = true;
|
|
63
|
+
|
|
64
|
+
player.Begin(allowPhysicalInput);
|
|
65
|
+
spawner.Begin(this);
|
|
66
|
+
ScoreChanged?.Invoke(0);
|
|
67
|
+
DoubleScoreChanged?.Invoke(false);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public void Stop()
|
|
71
|
+
{
|
|
72
|
+
IsRunning = false;
|
|
73
|
+
player.Stop();
|
|
74
|
+
spawner.Clear();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public void HitObstacle()
|
|
78
|
+
{
|
|
79
|
+
if (!IsRunning) return;
|
|
80
|
+
IsRunning = false;
|
|
81
|
+
player.Stop();
|
|
82
|
+
GameOverRequested?.Invoke();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public void CollectDoubleScore()
|
|
86
|
+
{
|
|
87
|
+
if (!IsRunning) return;
|
|
88
|
+
bool wasInactive = doubleScoreRemaining <= 0f;
|
|
89
|
+
doubleScoreRemaining = doubleScoreDuration;
|
|
90
|
+
if (wasInactive) DoubleScoreChanged?.Invoke(true);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace HyperSamples.LaneRunner
|
|
5
|
+
{
|
|
6
|
+
[RequireComponent(typeof(Rigidbody), typeof(BoxCollider))]
|
|
7
|
+
public sealed class LaneRunnerPlayer : MonoBehaviour
|
|
8
|
+
{
|
|
9
|
+
[SerializeField] private Rigidbody body;
|
|
10
|
+
[SerializeField] private float laneWidth = 2.4f;
|
|
11
|
+
[SerializeField] private float laneChangeSpeed = 14f;
|
|
12
|
+
[SerializeField] private float jumpVelocity = 7.5f;
|
|
13
|
+
[SerializeField] private float swipeThreshold = 45f;
|
|
14
|
+
[SerializeField] private Vector3 startPosition = new Vector3(0f, 0.68f, 0f);
|
|
15
|
+
|
|
16
|
+
public event Action<LaneRunnerCommand> CommandApplied;
|
|
17
|
+
|
|
18
|
+
private int targetLane;
|
|
19
|
+
private int pendingLaneDelta;
|
|
20
|
+
private bool jumpPending;
|
|
21
|
+
private bool inputEnabled;
|
|
22
|
+
private Vector2 touchStart;
|
|
23
|
+
private bool trackingTouch;
|
|
24
|
+
|
|
25
|
+
private void Reset()
|
|
26
|
+
{
|
|
27
|
+
body = GetComponent<Rigidbody>();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private void Awake()
|
|
31
|
+
{
|
|
32
|
+
if (body == null) body = GetComponent<Rigidbody>();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private void Update()
|
|
36
|
+
{
|
|
37
|
+
if (!inputEnabled) return;
|
|
38
|
+
|
|
39
|
+
if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.A))
|
|
40
|
+
QueueCommand(LaneRunnerCommand.MoveLeft);
|
|
41
|
+
if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.D))
|
|
42
|
+
QueueCommand(LaneRunnerCommand.MoveRight);
|
|
43
|
+
if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.UpArrow))
|
|
44
|
+
QueueCommand(LaneRunnerCommand.Jump);
|
|
45
|
+
|
|
46
|
+
ReadTouchInput();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private void FixedUpdate()
|
|
50
|
+
{
|
|
51
|
+
if (pendingLaneDelta != 0)
|
|
52
|
+
{
|
|
53
|
+
int nextLane = Mathf.Clamp(targetLane + pendingLaneDelta, -1, 1);
|
|
54
|
+
pendingLaneDelta = 0;
|
|
55
|
+
Debug.Log($"LaneRunnerPlayer: Moving from lane {targetLane} to {nextLane}");
|
|
56
|
+
if (nextLane != targetLane)
|
|
57
|
+
{
|
|
58
|
+
LaneRunnerCommand applied = nextLane < targetLane
|
|
59
|
+
? LaneRunnerCommand.MoveLeft
|
|
60
|
+
: LaneRunnerCommand.MoveRight;
|
|
61
|
+
targetLane = nextLane;
|
|
62
|
+
Debug.Log($"targetLane updated to {targetLane}");
|
|
63
|
+
CommandApplied?.Invoke(applied);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (jumpPending)
|
|
68
|
+
{
|
|
69
|
+
jumpPending = false;
|
|
70
|
+
if (IsGrounded())
|
|
71
|
+
{
|
|
72
|
+
Vector3 velocity = body.linearVelocity;
|
|
73
|
+
velocity.y = jumpVelocity;
|
|
74
|
+
body.linearVelocity = velocity;
|
|
75
|
+
CommandApplied?.Invoke(LaneRunnerCommand.Jump);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
Vector3 position = body.position;
|
|
80
|
+
position.z = Mathf.MoveTowards(position.z, targetLane * -laneWidth,
|
|
81
|
+
laneChangeSpeed * Time.fixedDeltaTime);
|
|
82
|
+
body.MovePosition(position);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public void QueueCommand(LaneRunnerCommand command)
|
|
86
|
+
{
|
|
87
|
+
switch (command)
|
|
88
|
+
{
|
|
89
|
+
case LaneRunnerCommand.MoveLeft:
|
|
90
|
+
pendingLaneDelta = -1;
|
|
91
|
+
break;
|
|
92
|
+
case LaneRunnerCommand.MoveRight:
|
|
93
|
+
pendingLaneDelta = 1;
|
|
94
|
+
break;
|
|
95
|
+
case LaneRunnerCommand.Jump:
|
|
96
|
+
jumpPending = true;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public void Begin(bool allowPhysicalInput)
|
|
102
|
+
{
|
|
103
|
+
targetLane = 0;
|
|
104
|
+
pendingLaneDelta = 0;
|
|
105
|
+
jumpPending = false;
|
|
106
|
+
inputEnabled = allowPhysicalInput;
|
|
107
|
+
trackingTouch = false;
|
|
108
|
+
body.position = startPosition;
|
|
109
|
+
body.rotation = Quaternion.identity;
|
|
110
|
+
body.linearVelocity = Vector3.zero;
|
|
111
|
+
body.angularVelocity = Vector3.zero;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public void Stop()
|
|
115
|
+
{
|
|
116
|
+
inputEnabled = false;
|
|
117
|
+
pendingLaneDelta = 0;
|
|
118
|
+
jumpPending = false;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
private bool IsGrounded()
|
|
122
|
+
{
|
|
123
|
+
return body.position.y <= 0.68f && body.linearVelocity.y <= 0.05f;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
private void ReadTouchInput()
|
|
127
|
+
{
|
|
128
|
+
if (Input.touchCount == 0)
|
|
129
|
+
{
|
|
130
|
+
trackingTouch = false;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
Touch touch = Input.GetTouch(0);
|
|
135
|
+
if (touch.phase == TouchPhase.Began)
|
|
136
|
+
{
|
|
137
|
+
touchStart = touch.position;
|
|
138
|
+
trackingTouch = true;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (!trackingTouch || (touch.phase != TouchPhase.Ended && touch.phase != TouchPhase.Canceled))
|
|
143
|
+
return;
|
|
144
|
+
|
|
145
|
+
trackingTouch = false;
|
|
146
|
+
Vector2 swipe = touch.position - touchStart;
|
|
147
|
+
if (swipe.magnitude < swipeThreshold) return;
|
|
148
|
+
|
|
149
|
+
if (Mathf.Abs(swipe.x) > Mathf.Abs(swipe.y))
|
|
150
|
+
QueueCommand(swipe.x < 0f ? LaneRunnerCommand.MoveLeft : LaneRunnerCommand.MoveRight);
|
|
151
|
+
else if (swipe.y > 0f)
|
|
152
|
+
QueueCommand(LaneRunnerCommand.Jump);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|