diff --git a/Assets/Resources/Games/bouncyRoad.prefab b/Assets/Resources/Games/bouncyRoad.prefab index bd5b5ad8..0c3ff8f0 100644 --- a/Assets/Resources/Games/bouncyRoad.prefab +++ b/Assets/Resources/Games/bouncyRoad.prefab @@ -75,6 +75,90 @@ Camera: m_OcclusionCulling: 0 m_StereoConvergence: 10 m_StereoSeparation: 0.022 +--- !u!1 &779842642987536956 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5505106653814911072} + - component: {fileID: 719670796437226359} + m_Layer: 0 + m_Name: Low + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5505106653814911072 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 779842642987536956} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -40, z: 20} + m_LocalScale: {x: 200, y: 50, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2791294817650574846} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &719670796437226359 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 779842642987536956} + 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: -1000 + m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 --- !u!1 &918886259350227450 GameObject: m_ObjectHideFlags: 0 @@ -107,7 +191,7 @@ Transform: - {fileID: 2723176266132450488} - {fileID: 5276051793785831601} - {fileID: 3775776905027717847} - - {fileID: 5824809245171685558} + - {fileID: 2791294817650574846} - {fileID: 2554041347942322038} - {fileID: 5331598396978286576} - {fileID: 2062427345527210161} @@ -135,6 +219,93 @@ MonoBehaviour: ThingsTrans: {fileID: 2062427345527210161} PosCurve: {fileID: 1821895289258124684} fallY: -10 + BGGradient: {fileID: 8550399596802296912} + BGHigh: {fileID: 723015850799809450} + BGLow: {fileID: 719670796437226359} +--- !u!1 &1390103326123173002 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3110034411422787401} + - component: {fileID: 723015850799809450} + m_Layer: 0 + m_Name: High + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3110034411422787401 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1390103326123173002} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 40, z: 20} + m_LocalScale: {x: 200, y: 50, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2791294817650574846} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &723015850799809450 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1390103326123173002} + 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: -1000 + m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3} + m_Color: {r: 0.003921569, g: 0.59607846, b: 0.99607843, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 --- !u!1 &2761970376181234193 GameObject: m_ObjectHideFlags: 0 @@ -534,7 +705,7 @@ GameObject: - component: {fileID: 5824809245171685558} - component: {fileID: 8550399596802296912} m_Layer: 0 - m_Name: BG + m_Name: Gradient m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -548,12 +719,12 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5152389461773555234} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -8, y: 0, z: 20} - m_LocalScale: {x: 48.1777, y: 2.1424723, z: 0.95581} + m_LocalPosition: {x: 0, y: 0, z: 20} + m_LocalScale: {x: 181.82, y: 2.1424723, z: 1 m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 2867745997132204233} - m_RootOrder: 3 + m_Father: {fileID: 2791294817650574846} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &8550399596802296912 SpriteRenderer: @@ -595,7 +766,7 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: -1000 + m_SortingOrder: -999 m_Sprite: {fileID: -2010126057, guid: b1573b9bbfeef24468e4b72a1c110a69, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 @@ -686,6 +857,40 @@ Transform: m_Father: {fileID: 2867745997132204233} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6231296930979203387 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2791294817650574846} + m_Layer: 0 + m_Name: BG + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2791294817650574846 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6231296930979203387} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5824809245171685558} + - {fileID: 3110034411422787401} + - {fileID: 5505106653814911072} + m_Father: {fileID: 2867745997132204233} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &6928869790579783110 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Resources/Sprites/Games/BouncyRoad/Bouncy Road.png.meta b/Assets/Resources/Sprites/Games/BouncyRoad/Bouncy Road.png.meta index da6ee301..858ac7c2 100644 --- a/Assets/Resources/Sprites/Games/BouncyRoad/Bouncy Road.png.meta +++ b/Assets/Resources/Sprites/Games/BouncyRoad/Bouncy Road.png.meta @@ -192,9 +192,9 @@ TextureImporter: name: Gradient (Prolly will be replaced) rect: serializedVersion: 2 - x: 1846 + x: 1894 y: 0 - width: 202 + width: 154 height: 2048 alignment: 0 pivot: {x: 0.5, y: 0.5} diff --git a/Assets/Scripts/Games/BouncyRoad/BouncyRoad.cs b/Assets/Scripts/Games/BouncyRoad/BouncyRoad.cs index 37581a1a..0631c6ff 100644 --- a/Assets/Scripts/Games/BouncyRoad/BouncyRoad.cs +++ b/Assets/Scripts/Games/BouncyRoad/BouncyRoad.cs @@ -26,6 +26,37 @@ namespace HeavenStudio.Games.Loaders new Param("color", Color.white, "Color", "Choose the color of the ball."), } }, + new GameAction("background appearance", "Background Appearance") + { + function = delegate { + var e = eventCaller.currentEntity; + BouncyRoad.instance.BackgroundColorSet(e.beat, e.length, e["colorBG1Start"], e["colorBG1End"], e["colorBG2Start"], e["colorBG2End"], e["ease"]); + }, + defaultLength = 0.5f, + resizable = true, + parameters = new List() + { + new Param("colorBG1Start", new Color(0.004f, 0.596f, 0.996f), "Start BG Color", "Set top-most color of the background gradient at the start of the event."), + new Param("colorBG1End", new Color(0.004f, 0.596f, 0.996f), "End BG Color", "Set top-most color of the background gradient at the end of the event."), + new Param("colorBG2Start", Color.black, "Start BG Color", "Set bottom-most color of the background gradient at the start of the event."), + new Param("colorBG2End",Color.black, "End BG Color", "Set bottom-most color of the background gradient at the end of the event."), + new Param("ease", Util.EasingFunction.Ease.Instant, "Ease", "Set the easing of the action."), + } + }, + // new GameAction("object appearance", "Object Appearance") + // { + // function = delegate { + // var e = eventCaller.currentEntity; + // BouncyRoad.instance.ObjectColorSet(e["color1"], e["color2"], e["color3"]); + // }, + // defaultLength = 0.5f, + // parameters = new List() + // { + // new Param("color1", new Color(1, 1, 1), "Color 1"), + // new Param("color2", new Color(1, 1, 1), "Color 2"), + // new Param("color3", new Color(1, 1, 1), "Color 3"), + // } + // }, }, new List() { "agb", "normal" }, "agbbouncy", "en", @@ -52,6 +83,9 @@ namespace HeavenStudio.Games [SerializeField] float fallY; + [SerializeField] private SpriteRenderer BGGradient, BGHigh, BGLow; + private ColorEase[] colorEases = new ColorEase[2]; + const double BALL_SEEK_TIME = 1.0; private struct ScheduledBall { @@ -100,6 +134,11 @@ namespace HeavenStudio.Games void Awake() { instance = this; + + colorEases = new ColorEase[] { + new(new Color(0.004f, 0.596f, 0.996f)), + new(Color.black), + }; ThingsAnim = new Animator[ThingsTrans.childCount]; int childIndex = 0; @@ -193,6 +232,7 @@ namespace HeavenStudio.Games } UpdateBalls(); + UpdateBackgroundColor(); } void UpdateBalls() @@ -310,5 +350,26 @@ namespace HeavenStudio.Games return newCurves; } + + public void BackgroundColorSet(double beat, float length, Color BG1Start, Color BG1End, Color BG2Start, Color BG2End, int colorEaseSet) + { + colorEases = new ColorEase[] { + new(beat, length, BG1Start, BG1End, colorEaseSet), + new(beat, length, BG2Start, BG2End, colorEaseSet), + }; + + UpdateBackgroundColor(); + } + public void ObjectColorSet(Color Color1, Color Color2, Color Color3) + { + + } + private void UpdateBackgroundColor() + { + BGGradient.material.SetColor("_ColorAlpha", colorEases[0].GetColor()); + BGGradient.material.SetColor("_ColorDelta", colorEases[1].GetColor()); + BGHigh.color = colorEases[0].GetColor(); + BGLow.color = colorEases[1].GetColor(); + } } }