diff --git a/Assets/Resources/Games/builtToScaleRvl.prefab b/Assets/Resources/Games/builtToScaleRvl.prefab index deb8da398..0795f35bc 100644 --- a/Assets/Resources/Games/builtToScaleRvl.prefab +++ b/Assets/Resources/Games/builtToScaleRvl.prefab @@ -107,8 +107,8 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 1 - m_Sprite: {fileID: 21300000, guid: 82ae6231b5099b74d822ff4886878ac5, type: 3} + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: a8297032b37ff954a8d811e6a72a8514, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 @@ -297,6 +297,7 @@ MonoBehaviour: baseRod: {fileID: 8551363978587200910} baseLeftSquare: {fileID: 4226438005871042715} baseRightSquare: {fileID: 6631181169301220531} + baseAssembled: {fileID: 3641708035931060140} widgetHolder: {fileID: 4637116116151750227} spawnedRods: [] --- !u!1 &2358395901572022390 @@ -608,7 +609,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2986222095836127005} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -2.6750002, y: 2.9083333, z: 0} + m_LocalPosition: {x: -2.71, y: 2.9, z: 0} m_LocalScale: {x: 0.2625, y: 0.2625, z: 0.2625} m_ConstrainProportionsScale: 0 m_Children: [] @@ -655,8 +656,8 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 0 - m_Sprite: {fileID: -1692917180, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + m_SortingOrder: 1 + m_Sprite: {fileID: -1616201231, guid: f77716464d1f0864fbad93cdacd39630, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 @@ -775,6 +776,7 @@ GameObject: - component: {fileID: 6695021389572934899} - component: {fileID: 1549991378792668010} - component: {fileID: 629397285465746108} + - component: {fileID: 4339725719184940571} m_Layer: 0 m_Name: assembled m_TagString: Untagged @@ -797,6 +799,7 @@ Transform: - {fileID: 355807372439853414} - {fileID: 9054330022322824652} - {fileID: 4665508336833487718} + - {fileID: 5493405571557473915} m_Father: {fileID: 7878645272756556695} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -832,6 +835,21 @@ SortingGroup: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 1 +--- !u!114 &4339725719184940571 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3641708035931060140} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4a58a1412715a2c44871302b982e0df8, type: 3} + m_Name: + m_EditorClassIdentifier: + anim: + beat: 0 + CorrectionPos: {x: 0, y: 0, z: 0} --- !u!1 &3874033564999961301 GameObject: m_ObjectHideFlags: 0 @@ -857,7 +875,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3874033564999961301} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -2.55, y: 3.45, z: 0} + m_LocalPosition: {x: -2.57, y: 3.17, z: 0} m_LocalScale: {x: 0.2625, y: 0.2625, z: 0.2625} m_ConstrainProportionsScale: 0 m_Children: [] @@ -904,9 +922,9 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 1 + m_SortingOrder: 2 m_Sprite: {fileID: -2012689479, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 0.7058824} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 @@ -1093,7 +1111,7 @@ GameObject: m_Component: - component: {fileID: 7878645272756556695} m_Layer: 0 - m_Name: prefab + m_Name: prefabs m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1544,7 +1562,7 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 2 + m_SortingOrder: 3 m_Sprite: {fileID: -1616201231, guid: f77716464d1f0864fbad93cdacd39630, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 @@ -1928,6 +1946,90 @@ MonoBehaviour: handleType: 0 leftHandleLocalPosition: {x: -0.19655323, y: 0.27517438, z: -0} rightHandleLocalPosition: {x: 0.19655323, y: -0.27517438, z: 0} +--- !u!1 &7193241726870690616 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5493405571557473915} + - component: {fileID: 7800297585350906680} + m_Layer: 0 + m_Name: rod + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &5493405571557473915 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7193241726870690616} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.894, y: 3.644, z: 0} + m_LocalScale: {x: 0.2625, y: 0.2625, z: 0.2625} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6695021389572934899} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &7800297585350906680 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7193241726870690616} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: -2 + m_Sprite: {fileID: -94706311, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 2.3799999, y: 1.78} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 --- !u!1 &7384901947128525432 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Resources/Sprites/Games/BuiltToScaleRvl/Animations/assembled.anim b/Assets/Resources/Sprites/Games/BuiltToScaleRvl/Animations/assembled.anim index 0514439cc..75cc7afc6 100644 --- a/Assets/Resources/Sprites/Games/BuiltToScaleRvl/Animations/assembled.anim +++ b/Assets/Resources/Sprites/Games/BuiltToScaleRvl/Animations/assembled.anim @@ -21,25 +21,212 @@ AnimationClip: - serializedVersion: 3 time: 0 value: {x: 0, y: 0, z: 0} - inSlope: {x: 0, y: 0, z: 0} - outSlope: {x: 0, y: 0, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.06666667 + value: {x: 0, y: 0, z: 0} + inSlope: {x: -2.5, y: 2.5, z: 0} + outSlope: {x: -2.5, y: 2.5, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.16666667 + value: {x: -0.5, y: 0.5, z: 0} + inSlope: {x: -2.6999998, y: 2.6999998, z: 0} + outSlope: {x: -2.6999998, y: 2.6999998, z: 0} tangentMode: 0 weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} - serializedVersion: 3 time: 0.4 - value: {x: -0.84, y: 0.84, z: 0} + value: {x: -0.9, y: 0.9, z: 0} inSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0} tangentMode: 0 weightedMode: 0 + inWeight: {x: 0.33333334, y: 0, z: 0.33333334} + outWeight: {x: 0.33333334, y: 1, z: 0.33333334} + - serializedVersion: 3 + time: 0.43333334 + value: {x: -1, y: 1.03, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.46666667 + value: {x: -1.12, y: 1.12, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.5 + value: {x: -1.32, y: 1.1, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.53333336 + value: {x: -1.38, y: 0.9, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.56666666 + value: {x: -1.38, y: 0.78, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.6 + value: {x: -1.38, y: 0.65, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.6333333 + value: {x: -1.38, y: 0.55, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.6666667 + value: {x: -1.35, y: 0.34, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: 0, y: -6.0000014, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.8333333 + value: {x: -1.35, y: -0.66, z: 0} + inSlope: {x: 0, y: -6.0000014, z: 0} + outSlope: {x: 0, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 path: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: -2.454, y: 2.658, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.43333334 + value: {x: -2.46, y: 2.79, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.46666667 + value: {x: -2.49, y: 2.97, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.5 + value: {x: -2.66, y: 3.25, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.53333336 + value: {x: -2.755, y: 3.364, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.56666666 + value: {x: -2.83, y: 3.34, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.6 + value: {x: -2.86, y: 3.36, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.6333333 + value: {x: -2.88, y: 3.33, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.6666667 + value: {x: -2.96, y: 3.28, z: 0} + inSlope: {x: Infinity, y: Infinity, z: 0} + outSlope: {x: Infinity, y: Infinity, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: front m_ScaleCurves: [] m_FloatCurves: - curve: @@ -55,7 +242,7 @@ AnimationClip: inWeight: 0 outWeight: 0 - serializedVersion: 3 - time: 0.06666667 + time: 0.033333335 value: 0 inSlope: Infinity outSlope: Infinity @@ -70,10 +257,66 @@ AnimationClip: path: shock classID: 1 script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 3 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6333333 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_SortingOrder + path: front + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6333333 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: rod + classID: 1 + script: {fileID: 0} m_PPtrCurves: - curve: - time: 0 - value: {fileID: -1692917180, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + value: {fileID: -1616201231, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - time: 0.43333334 value: {fileID: 1140548742, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - time: 0.46666667 @@ -83,13 +326,13 @@ AnimationClip: - time: 0.53333336 value: {fileID: -1181580059, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - time: 0.56666666 - value: {fileID: 548264023, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - time: 0.6 value: {fileID: -1387068085, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - time: 0.6 + value: {fileID: 548264023, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - time: 0.6333333 - value: {fileID: 597307425, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - time: 0.6666667 value: {fileID: -1458010756, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - time: 0.6666667 + value: {fileID: 597307425, guid: f77716464d1f0864fbad93cdacd39630, type: 3} attribute: m_Sprite path: back classID: 212 @@ -106,13 +349,13 @@ AnimationClip: - time: 0.53333336 value: {fileID: -1181580059, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - time: 0.56666666 - value: {fileID: 548264023, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - time: 0.6 value: {fileID: -1387068085, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - time: 0.6 + value: {fileID: 548264023, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - time: 0.6333333 - value: {fileID: 597307425, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - time: 0.6666667 value: {fileID: -1458010756, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - time: 0.6666667 + value: {fileID: 597307425, guid: f77716464d1f0864fbad93cdacd39630, type: 3} attribute: m_Sprite path: front classID: 212 @@ -131,6 +374,13 @@ AnimationClip: typeID: 4 customType: 0 isPPtrCurve: 0 + - serializedVersion: 2 + path: 4277887734 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 - serializedVersion: 2 path: 1375321671 attribute: 2086281974 @@ -138,6 +388,20 @@ AnimationClip: typeID: 1 customType: 0 isPPtrCurve: 0 + - serializedVersion: 2 + path: 4277887734 + attribute: 3762991556 + script: {fileID: 0} + typeID: 212 + customType: 26 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 9352965 + attribute: 2086281974 + script: {fileID: 0} + typeID: 1 + customType: 0 + isPPtrCurve: 0 - serializedVersion: 2 path: 1842266423 attribute: 0 @@ -153,35 +417,35 @@ AnimationClip: customType: 23 isPPtrCurve: 1 pptrCurveMapping: - - {fileID: -1692917180, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - {fileID: 1140548742, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - {fileID: -2082090629, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - {fileID: -1625031748, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - {fileID: -1181580059, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - {fileID: 548264023, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - {fileID: -1387068085, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - {fileID: 597307425, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - {fileID: -1458010756, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - {fileID: -1616201231, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - {fileID: 1140548742, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - {fileID: -2082090629, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - {fileID: -1625031748, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - {fileID: -1181580059, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - {fileID: 548264023, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - {fileID: -1387068085, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - - {fileID: 597307425, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - {fileID: 548264023, guid: f77716464d1f0864fbad93cdacd39630, type: 3} - {fileID: -1458010756, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - {fileID: 597307425, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - {fileID: -1616201231, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - {fileID: 1140548742, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - {fileID: -2082090629, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - {fileID: -1625031748, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - {fileID: -1181580059, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - {fileID: -1387068085, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - {fileID: 548264023, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - {fileID: -1458010756, guid: f77716464d1f0864fbad93cdacd39630, type: 3} + - {fileID: 597307425, guid: f77716464d1f0864fbad93cdacd39630, type: 3} m_AnimationClipSettings: serializedVersion: 2 m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseTime: 0 m_StartTime: 0 - m_StopTime: 0.70000005 + m_StopTime: 0.8333333 m_OrientationOffsetY: 0 m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 @@ -205,7 +469,7 @@ AnimationClip: inWeight: 0 outWeight: 0 - serializedVersion: 3 - time: 0.06666667 + time: 0.033333335 value: 0 inSlope: Infinity outSlope: Infinity @@ -226,18 +490,108 @@ AnimationClip: - serializedVersion: 3 time: 0 value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 136 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.06666667 + value: 0 + inSlope: -2.5 + outSlope: -2.5 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: -0.5 + inSlope: -2.6999998 + outSlope: -2.6999998 + tangentMode: 0 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.4 - value: -0.84 + value: -0.9 inSlope: 0 outSlope: 0 - tangentMode: 136 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.43333334 + value: -1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.46666667 + value: -1.12 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: -1.32 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.53333336 + value: -1.38 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.56666666 + value: -1.38 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6 + value: -1.38 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6333333 + value: -1.38 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: -1.35 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 @@ -254,18 +608,117 @@ AnimationClip: - serializedVersion: 3 time: 0 value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 136 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.06666667 + value: 0 + inSlope: 2.5 + outSlope: 2.5 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 0.5 + inSlope: 2.6999998 + outSlope: 2.6999998 + tangentMode: 0 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - serializedVersion: 3 time: 0.4 - value: 0.84 + value: 0.9 inSlope: 0 outSlope: 0 - tangentMode: 136 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 1 + - serializedVersion: 3 + time: 0.43333334 + value: 1.03 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.46666667 + value: 1.12 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 1.1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.53333336 + value: 0.9 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.56666666 + value: 0.78 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6 + value: 0.65 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6333333 + value: 0.55 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0.34 + inSlope: Infinity + outSlope: -6.0000014 + tangentMode: 71 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8333333 + value: -0.66 + inSlope: -6.0000014 + outSlope: Infinity + tangentMode: 69 weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 @@ -288,15 +741,6 @@ AnimationClip: weightedMode: 0 inWeight: 0.33333334 outWeight: 0.33333334 - - serializedVersion: 3 - time: 0.4 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 136 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 @@ -304,7 +748,278 @@ AnimationClip: path: classID: 4 script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -2.454 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.43333334 + value: -2.46 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.46666667 + value: -2.49 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: -2.66 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.53333336 + value: -2.755 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.56666666 + value: -2.83 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6 + value: -2.86 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6333333 + value: -2.88 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: -2.96 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.x + path: front + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 2.658 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.43333334 + value: 2.79 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.46666667 + value: 2.97 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 3.25 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.53333336 + value: 3.364 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.56666666 + value: 3.34 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6 + value: 3.36 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6333333 + value: 3.33 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 3.28 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.y + path: front + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.z + path: front + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 3 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6333333 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_SortingOrder + path: front + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6333333 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: rod + classID: 1 + script: {fileID: 0} m_EulerEditorCurves: [] m_HasGenericRootTransform: 1 m_HasMotionFloatCurves: 0 - m_Events: [] + m_Events: + - time: 0.6333333 + functionName: ChangeSortingOrder + data: + objectReferenceParameter: {fileID: 0} + floatParameter: 0 + intParameter: -1 + messageOptions: 0 + - time: 0.8333333 + functionName: End + data: + objectReferenceParameter: {fileID: 0} + floatParameter: 0 + intParameter: 0 + messageOptions: 0 diff --git a/Assets/Scripts/Games/BuiltToScaleRvl/BuiltToScaleRvl.cs b/Assets/Scripts/Games/BuiltToScaleRvl/BuiltToScaleRvl.cs index d2b9529b4..58fe4c139 100644 --- a/Assets/Scripts/Games/BuiltToScaleRvl/BuiltToScaleRvl.cs +++ b/Assets/Scripts/Games/BuiltToScaleRvl/BuiltToScaleRvl.cs @@ -31,7 +31,7 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("shoot rod", "Shoot Rod") { - function = delegate { var e = eventCaller.currentEntity; BuiltToScaleRvl.instance.ShootRod(e.beat, e["id"]); }, + // function = delegate { var e = eventCaller.currentEntity; BuiltToScaleRvl.instance.ShootRod(e.beat, e["id"]); }, defaultLength = 1f, parameters = new List() { @@ -40,7 +40,7 @@ namespace HeavenStudio.Games.Loaders }, new GameAction("out sides", "Bounce Out Sides") { - function = delegate { var e = eventCaller.currentEntity; BuiltToScaleRvl.instance.OutRod(e.beat, e["id"]); }, + // function = delegate { var e = eventCaller.currentEntity; BuiltToScaleRvl.instance.OutRod(e.beat, e["id"]); }, defaultLength = 1f, parameters = new List() { @@ -61,6 +61,7 @@ namespace HeavenStudio.Games [SerializeField] GameObject baseRod; [SerializeField] GameObject baseLeftSquare; [SerializeField] GameObject baseRightSquare; + [SerializeField] GameObject baseAssembled; public Transform widgetHolder; public enum Direction { @@ -91,7 +92,8 @@ namespace HeavenStudio.Games instance = this; } - private double endBeat = double.MaxValue; + private double gameStartBeat = double.MinValue; + private double gameEndBeat = double.MaxValue; public static List queuedRods = new List(); public List spawnedRods = new List(); @@ -107,13 +109,15 @@ namespace HeavenStudio.Games public override void OnPlay(double beat) { queuedRods.Clear(); - var firstEnd = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "switchGame", "end" }).Find(x => x.beat > beat); - endBeat = firstEnd?.beat ?? endBeat; + gameStartBeat = beat; + var firstEnd = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "switchGame", "end" }).Find(x => x.beat > gameStartBeat); + gameEndBeat = firstEnd?.beat ?? gameEndBeat; } public override void OnGameSwitch(double beat) { - var firstEnd = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "switchGame", "end" }).Find(x => x.beat > beat); - endBeat = firstEnd?.beat ?? endBeat; + gameStartBeat = beat; + var firstEnd = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "switchGame", "end" }).Find(x => x.beat > gameStartBeat); + gameEndBeat = firstEnd?.beat ?? gameEndBeat; } private void OnDestroy() { queuedRods.Clear(); @@ -180,26 +184,94 @@ namespace HeavenStudio.Games if (spawnedRods.Any(x => x.ID == id)) return; var newRod = Instantiate(baseRod, widgetHolder).GetComponent(); spawnedRods.Add(newRod); + newRod.startBeat = beat; newRod.lengthBeat = length; - newRod.ID = id; - newRod.currentPos = currentPos; newRod.nextPos = nextPos; + newRod.ID = id; + + bool isShoot; + double rodEndBeat = CalcRodEndBeat(beat, length, currentPos, nextPos, id, out isShoot); + newRod.endBeat = rodEndBeat; + newRod.isShoot = isShoot; + if (rodEndBeat != double.MaxValue) + { + newRod.Squares = SpawnSquare(beat, rodEndBeat, id); + } + newRod.Init(); newRod.gameObject.SetActive(true); } - public void ShootRod(double beat, int id) + private Square[] SpawnSquare(double startBeat, double endBeat, int id) { var newLeftSquare = Instantiate(baseLeftSquare, widgetHolder).GetComponent(); var newRightSquare = Instantiate(baseRightSquare, widgetHolder).GetComponent(); - newLeftSquare.beat = beat; - newRightSquare.beat = beat; - newLeftSquare.Init(); - newRightSquare.Init(); + newLeftSquare.startBeat = startBeat; + newRightSquare.startBeat = startBeat; + newLeftSquare.endBeat = endBeat; + newRightSquare.endBeat = endBeat; newLeftSquare.gameObject.SetActive(true); newRightSquare.gameObject.SetActive(true); + newLeftSquare.Init(); + newRightSquare.Init(); + + return new Square[]{newLeftSquare, newRightSquare}; + } + + public void SpawnAssembled() + { + var newAssembled =Instantiate(baseAssembled, widgetHolder); + newAssembled.SetActive(true); + } + + private double CalcRodEndBeat(double beat, double length, int currentPos, int nextPos, int id, out bool isShoot) + { + isShoot = false; + var firstShoot = EventCaller.GetAllInGameManagerList("builtToScaleRvl", new string[] { "shoot rod" }).Find(x => x.beat > beat && x["id"] == id); + if (firstShoot is null) + return double.MaxValue; + double shootEventBeat = firstShoot.beat; + + if (EventCaller.GetAllInGameManagerList("builtToScaleRvl", new string[] { "out sides" }).Any(x => x.beat > beat && x.beat < shootEventBeat && x["id"] == id)) + return double.MaxValue; + + var n = (int)Math.Ceiling((shootEventBeat-beat)/length); + int current = currentPos, next = nextPos; + int shootTiming; + for (int i = 0; ; i++) { + if (current == 2 && i >= n) { + shootTiming = i; + break; + } + int following = getFollowingPos(current, next); + current = next; + next = following; + } + isShoot = true; + return beat + length * shootTiming; + } + + int getFollowingPos(int currentPos, int nextPos) + { + if (nextPos == 0) return 1; + else if (nextPos == 3) return 2; + else if (currentPos < nextPos) return nextPos + 1; + else if (currentPos > nextPos) return nextPos - 1; + return nextPos; + } + + public void ShootRod(double beat, int id) + { + // var newLeftSquare = Instantiate(baseLeftSquare, widgetHolder).GetComponent(); + // var newRightSquare = Instantiate(baseRightSquare, widgetHolder).GetComponent(); + // newLeftSquare.beat = beat; + // newRightSquare.beat = beat; + // newLeftSquare.Init(); + // newRightSquare.Init(); + // newLeftSquare.gameObject.SetActive(true); + // newRightSquare.gameObject.SetActive(true); var rod = spawnedRods.Find(x => x.ID == id); if (rod is not null) { diff --git a/Assets/Scripts/Games/BuiltToScaleRvl/Rod.cs b/Assets/Scripts/Games/BuiltToScaleRvl/Rod.cs index 29c52ebee..41ce30e31 100644 --- a/Assets/Scripts/Games/BuiltToScaleRvl/Rod.cs +++ b/Assets/Scripts/Games/BuiltToScaleRvl/Rod.cs @@ -8,12 +8,14 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl using HeavenStudio.Util; public class Rod : MonoBehaviour { - public double startBeat, lengthBeat, currentBeat; + public double startBeat, lengthBeat, currentBeat, endBeat; public int currentPos, nextPos; public int ID; public BezierCurve3D[] curve; private BezierCurve3D currentCurve; private Animator rodAnim; + public bool isShoot = false; + public Square[] Squares; private bool isPreShoot = false; private bool isPreOut = false; private bool isMiss = false; @@ -103,7 +105,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl game.blockAnims[currentPos].Play("idle", 0, 0); }) }); - if (isPreShoot) { + if (isShoot && beat + length == endBeat) { SoundByte.PlayOneShotGame("builtToScaleRvl/prepare"); SoundByte.PlayOneShotGame("builtToScaleRvl/playerRetract", beat); BeatAction.New(this, new List() @@ -211,6 +213,10 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl { SoundByte.PlayOneShotGame("builtToScaleRvl/shoot"); game.blockAnims[nextPos].Play("shoot", 0, 0); + foreach (var square in Squares) { + Destroy(square.gameObject); + } + game.SpawnAssembled(); BeatAction.New(this, new List() { new BeatAction.Action(currentBeat + lengthBeat, delegate diff --git a/Assets/Scripts/Games/BuiltToScaleRvl/Square.cs b/Assets/Scripts/Games/BuiltToScaleRvl/Square.cs index 2a3b19394..2a46e7ac7 100644 --- a/Assets/Scripts/Games/BuiltToScaleRvl/Square.cs +++ b/Assets/Scripts/Games/BuiltToScaleRvl/Square.cs @@ -1,6 +1,8 @@ +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.Rendering; using NaughtyBezierCurves; namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl @@ -9,7 +11,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl public class Square : MonoBehaviour { public string anim; - public double beat; + public double startBeat, endBeat, lengthBeat = 1; public Vector3 CorrectionPos; private Animator squareAnim; @@ -19,15 +21,19 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl { game = BuiltToScaleRvl.instance; squareAnim = GetComponent(); - transform.position = transform.position - (10+1)*CorrectionPos; - Recursion(beat, 1); + var n = (int)Math.Floor((endBeat - startBeat)/lengthBeat); + transform.position = transform.position - n*CorrectionPos; + double beat = endBeat - lengthBeat * n; + Debug.Log(beat); + squareAnim.Play(anim, 0, 0); + Recursion(beat, lengthBeat); } private void Recursion(double beat, double length) { BeatAction.New(this, new List() { - new BeatAction.Action(beat, delegate + new BeatAction.Action(beat + length, delegate { transform.position = transform.position + CorrectionPos; squareAnim.Play(anim, 0, 0); @@ -36,11 +42,22 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl }); } - void PositionCorrection() { + void PositionCorrection() + { var pos = transform.position; Debug.Log(transform.position); transform.position = pos + CorrectionPos; Debug.Log(transform.position); } + + void ChangeSortingOrder(int order) + { + GetComponent().sortingOrder = order; + } + + void End() + { + Destroy(gameObject); + } } } \ No newline at end of file