diff --git a/.gitignore b/.gitignore index 6ad71155..6229a730 100644 --- a/.gitignore +++ b/.gitignore @@ -99,6 +99,8 @@ InitTestScene*.unity* # Auto-generated scenes by play mode tests /[Aa]ssets/[Ii]nit[Tt]est[Ss]cene*.unity* +.idea/.idea.AppleHillsProduction/.idea/indexLayout.xml .vscode/extensions.json .vscode/launch.json .vscode/settings.json +.idea/.idea.AppleHillsProduction/.idea/indexLayout.xml diff --git a/Assets/Editor/Utilities/SpriteColliderGenerator.cs b/Assets/Editor/Utilities/SpriteColliderGenerator.cs index 1d483390..02371e3c 100644 --- a/Assets/Editor/Utilities/SpriteColliderGenerator.cs +++ b/Assets/Editor/Utilities/SpriteColliderGenerator.cs @@ -43,6 +43,9 @@ namespace Editor.Utilities [Tooltip("Color used for previewing colliders in the scene view")] private Color previewColor = new Color(0.2f, 1f, 0.3f, 0.5f); + [Tooltip("Layer to assign to GameObjects when colliders are generated")] + private int targetLayer = 0; + private List previewMeshes = new List(); [MenuItem("Tools/Sprite Collider Generator")] @@ -51,8 +54,29 @@ namespace Editor.Utilities GetWindow("Sprite Collider Generator"); } + private void OnEnable() + { + // Subscribe to scene change events to clear invalid object references + UnityEditor.SceneManagement.EditorSceneManager.sceneOpened += OnSceneOpened; + UnityEditor.SceneManagement.EditorSceneManager.sceneClosed += OnSceneClosed; + + // Also subscribe to playmode changes as they can invalidate references + EditorApplication.playModeStateChanged += OnPlayModeStateChanged; + + // Subscribe to prefab stage changes (Unity 2018.3+) + UnityEditor.SceneManagement.PrefabStage.prefabStageOpened += OnPrefabStageOpened; + UnityEditor.SceneManagement.PrefabStage.prefabStageClosing += OnPrefabStageClosing; + } + private void OnDisable() { + // Unsubscribe from events + UnityEditor.SceneManagement.EditorSceneManager.sceneOpened -= OnSceneOpened; + UnityEditor.SceneManagement.EditorSceneManager.sceneClosed -= OnSceneClosed; + EditorApplication.playModeStateChanged -= OnPlayModeStateChanged; + UnityEditor.SceneManagement.PrefabStage.prefabStageOpened -= OnPrefabStageOpened; + UnityEditor.SceneManagement.PrefabStage.prefabStageClosing -= OnPrefabStageClosing; + // Clean up any preview meshes when window is closed foreach (var mesh in previewMeshes) { @@ -63,7 +87,53 @@ namespace Editor.Utilities } previewMeshes.Clear(); } + + private void OnSceneOpened(UnityEngine.SceneManagement.Scene scene, UnityEditor.SceneManagement.OpenSceneMode mode) + { + // Clear selected objects when a scene is opened + ClearInvalidReferences(); + } + + private void OnSceneClosed(UnityEngine.SceneManagement.Scene scene) + { + // Clear selected objects when a scene is closed + ClearInvalidReferences(); + } + + private void OnPlayModeStateChanged(PlayModeStateChange state) + { + // Clear references when entering/exiting play mode as they become invalid + if (state == PlayModeStateChange.ExitingEditMode || state == PlayModeStateChange.ExitingPlayMode) + { + ClearInvalidReferences(); + } + } + + private void OnPrefabStageOpened(UnityEditor.SceneManagement.PrefabStage stage) + { + // Clear selected objects when entering a prefab stage + ClearInvalidReferences(); + } + private void OnPrefabStageClosing(UnityEditor.SceneManagement.PrefabStage stage) + { + // Clear selected objects when exiting a prefab stage + ClearInvalidReferences(); + } + + /// + /// Clears invalid GameObject references from the selected objects list + /// + private void ClearInvalidReferences() + { + if (selectedObjects.Count > 0) + { + selectedObjects.Clear(); + ClearPreviews(); // Also clear any preview meshes + Repaint(); // Refresh the window UI + } + } + private void OnGUI() { EditorGUILayout.BeginVertical(); @@ -146,6 +216,12 @@ namespace Editor.Utilities new GUIContent("Generate Trigger Colliders", "When enabled, creates trigger colliders instead of solid colliders."), generateTriggerColliders); + // Layer selection + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField(new GUIContent("Target Layer:", "Layer to assign to GameObjects when colliders are generated. Leave as 'Nothing' to keep current layer."), GUILayout.Width(180)); + targetLayer = EditorGUILayout.LayerField(targetLayer); + EditorGUILayout.EndHorizontal(); + // Offset option offsetFromCenter = EditorGUILayout.Toggle( new GUIContent("Offset From Center", "When enabled, allows scaling the collider outward or inward from the sprite center."), @@ -445,8 +521,24 @@ namespace Editor.Utilities polygonCollider.SetPath(i, paths[i]); } + // Set the layer on the GameObject if a specific layer is selected + SetTargetLayer(targetObject); + return true; } + + /// + /// Sets the target layer on the GameObject if a layer is selected + /// + /// The GameObject to set the layer on + private void SetTargetLayer(GameObject targetObject) + { + if (targetLayer != 0) + { + Undo.RecordObject(targetObject, "Set GameObject Layer"); + targetObject.layer = targetLayer; + } + } private List GetSpritePaths(Sprite sprite, float tolerance) { diff --git a/Assets/Prefabs/Minigames/DivingForPictures/Tile1.prefab b/Assets/Prefabs/Minigames/DivingForPictures/Tile1.prefab index 2557bd2d..58964572 100644 --- a/Assets/Prefabs/Minigames/DivingForPictures/Tile1.prefab +++ b/Assets/Prefabs/Minigames/DivingForPictures/Tile1.prefab @@ -10,8 +10,8 @@ GameObject: m_Component: - component: {fileID: 7111145574660306503} - component: {fileID: 3889795708575321074} - - component: {fileID: 7249681423942450184} - m_Layer: 0 + - component: {fileID: 8688779957837852254} + m_Layer: 6 m_Name: Left_Tile2_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -88,7 +88,7 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!60 &7249681423942450184 +--- !u!60 &8688779957837852254 PolygonCollider2D: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -155,8 +155,8 @@ GameObject: m_Component: - component: {fileID: 1003080013996268193} - component: {fileID: 4856205316150460481} - - component: {fileID: 2843103852598642252} - m_Layer: 0 + - component: {fileID: 8615330168962481848} + m_Layer: 6 m_Name: Right_Tile1_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -233,7 +233,7 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!60 &2843103852598642252 +--- !u!60 &8615330168962481848 PolygonCollider2D: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -282,8 +282,6 @@ PolygonCollider2D: - - {x: -0.48499998, y: 2.5} - {x: -0.49499997, y: 2.19} - {x: 0.035, y: 1.66} - - {x: 0.035, y: 1.42} - - {x: -0.24499999, y: 1.15} - {x: -0.285, y: 0.90999997} - {x: -0.13499999, y: 0.45999998} - {x: -1.115, y: -0.03} diff --git a/Assets/Prefabs/Minigames/DivingForPictures/Tile1_flipped.prefab b/Assets/Prefabs/Minigames/DivingForPictures/Tile1_flipped.prefab index fc6ab7f1..adb3cac4 100644 --- a/Assets/Prefabs/Minigames/DivingForPictures/Tile1_flipped.prefab +++ b/Assets/Prefabs/Minigames/DivingForPictures/Tile1_flipped.prefab @@ -10,7 +10,8 @@ GameObject: m_Component: - component: {fileID: 7111145574660306503} - component: {fileID: 3889795708575321074} - m_Layer: 0 + - component: {fileID: 8698932925238153222} + m_Layer: 6 m_Name: Left_Tile2_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -87,6 +88,63 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!60 &8698932925238153222 +PolygonCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 864595161669782950} + m_Enabled: 1 + serializedVersion: 3 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_CompositeOperation: 0 + m_CompositeOrder: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 2.37, y: 5} + newSize: {x: 2.37, y: 5} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + m_Points: + m_Paths: + - - {x: 0.575, y: -1.5} + - {x: 0.185, y: -0.63} + - {x: 1.145, y: 0.85999995} + - {x: 1.185, y: 1.41} + - {x: 0.835, y: 1.8499999} + - {x: 0.635, y: 2.5} + - {x: -1.185, y: 2.5} + - {x: -1.185, y: -2.5} + - {x: 0.635, y: -2.5} + - {x: 0.625, y: -1.64} + m_UseDelaunayMesh: 0 --- !u!1 &2171518497100337372 GameObject: m_ObjectHideFlags: 0 @@ -97,7 +155,8 @@ GameObject: m_Component: - component: {fileID: 1003080013996268193} - component: {fileID: 4856205316150460481} - m_Layer: 0 + - component: {fileID: 1368284191430742655} + m_Layer: 6 m_Name: Right_Tile1_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -174,6 +233,67 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!60 &1368284191430742655 +PolygonCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2171518497100337372} + m_Enabled: 1 + serializedVersion: 3 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_CompositeOperation: 0 + m_CompositeOrder: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 2.65, y: 5} + newSize: {x: 2.65, y: 5} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + m_Points: + m_Paths: + - - {x: -0.48499998, y: 2.5} + - {x: -0.49499997, y: 2.19} + - {x: 0.035, y: 1.66} + - {x: -0.285, y: 0.90999997} + - {x: -0.13499999, y: 0.45999998} + - {x: -1.115, y: -0.03} + - {x: -1.3249999, y: -0.35} + - {x: -1.2049999, y: -0.84999996} + - {x: -0.36499998, y: -1.0699999} + - {x: -0.585, y: -1.27} + - {x: -0.625, y: -1.65} + - {x: -0.48499998, y: -2.5} + - {x: 1.3249999, y: -2.5} + - {x: 1.3249999, y: 2.5} + m_UseDelaunayMesh: 0 --- !u!1 &2956826569642009690 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Minigames/DivingForPictures/Tile2.prefab b/Assets/Prefabs/Minigames/DivingForPictures/Tile2.prefab index bc9918dc..467e61f5 100644 --- a/Assets/Prefabs/Minigames/DivingForPictures/Tile2.prefab +++ b/Assets/Prefabs/Minigames/DivingForPictures/Tile2.prefab @@ -10,7 +10,8 @@ GameObject: m_Component: - component: {fileID: 7111145574660306503} - component: {fileID: 3889795708575321074} - m_Layer: 0 + - component: {fileID: 6919687589473331973} + m_Layer: 6 m_Name: Left_Tile2_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -87,6 +88,72 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!60 &6919687589473331973 +PolygonCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 864595161669782950} + m_Enabled: 1 + serializedVersion: 3 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_CompositeOperation: 0 + m_CompositeOrder: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 2.65, y: 5} + newSize: {x: 2.37, y: 5} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + m_Points: + m_Paths: + - - {x: 0.635, y: -1.78} + - {x: 0.585, y: -1.27} + - {x: 0.36499998, y: -1.14} + - {x: 0.415, y: -1.05} + - {x: 1.2149999, y: -0.85999995} + - {x: 1.3249999, y: -0.7} + - {x: 1.3249999, y: -0.35} + - {x: 1.145, y: -0.049999997} + - {x: 0.13499999, y: 0.45999998} + - {x: 0.275, y: 0.87} + - {x: 0.265, y: 1.0699999} + - {x: -0.044999998, y: 1.41} + - {x: -0.035, y: 1.66} + - {x: 0.48499998, y: 2.2} + - {x: 0.49499997, y: 2.48} + - {x: -1.3249999, y: 2.5} + - {x: -1.3249999, y: -2.5} + - {x: 0.505, y: -2.5} + - {x: 0.555, y: -2.12} + m_UseDelaunayMesh: 0 --- !u!1 &2171518497100337372 GameObject: m_ObjectHideFlags: 0 @@ -97,7 +164,8 @@ GameObject: m_Component: - component: {fileID: 1003080013996268193} - component: {fileID: 4856205316150460481} - m_Layer: 0 + - component: {fileID: 1911291775322313535} + m_Layer: 6 m_Name: Right_Tile1_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -174,6 +242,65 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!60 &1911291775322313535 +PolygonCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2171518497100337372} + m_Enabled: 1 + serializedVersion: 3 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_CompositeOperation: 0 + m_CompositeOrder: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 2.37, y: 5} + newSize: {x: 2.65, y: 5} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + m_Points: + m_Paths: + - - {x: -0.635, y: 2.5} + - {x: -0.835, y: 1.8499999} + - {x: -1.185, y: 1.42} + - {x: -1.185, y: 1.06} + - {x: -1.055, y: 0.69} + - {x: -0.185, y: -0.65999997} + - {x: -0.175, y: -0.78999996} + - {x: -0.585, y: -1.49} + - {x: -0.675, y: -2.08} + - {x: -0.635, y: -2.5} + - {x: 1.185, y: -2.5} + - {x: 1.185, y: 2.5} + m_UseDelaunayMesh: 0 --- !u!1 &2956826569642009690 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Minigames/DivingForPictures/Tile2_flipped.prefab b/Assets/Prefabs/Minigames/DivingForPictures/Tile2_flipped.prefab index 08587f8a..d6cb1781 100644 --- a/Assets/Prefabs/Minigames/DivingForPictures/Tile2_flipped.prefab +++ b/Assets/Prefabs/Minigames/DivingForPictures/Tile2_flipped.prefab @@ -10,7 +10,8 @@ GameObject: m_Component: - component: {fileID: 7111145574660306503} - component: {fileID: 3889795708575321074} - m_Layer: 0 + - component: {fileID: 3320970211105392876} + m_Layer: 6 m_Name: Left_Tile2_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -87,6 +88,72 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!60 &3320970211105392876 +PolygonCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 864595161669782950} + m_Enabled: 1 + serializedVersion: 3 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_CompositeOperation: 0 + m_CompositeOrder: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 2.65, y: 5} + newSize: {x: 2.37, y: 5} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + m_Points: + m_Paths: + - - {x: 0.635, y: -1.78} + - {x: 0.585, y: -1.27} + - {x: 0.36499998, y: -1.14} + - {x: 0.415, y: -1.05} + - {x: 1.2149999, y: -0.85999995} + - {x: 1.3249999, y: -0.7} + - {x: 1.3249999, y: -0.35} + - {x: 1.145, y: -0.049999997} + - {x: 0.13499999, y: 0.45999998} + - {x: 0.275, y: 0.87} + - {x: 0.265, y: 1.0699999} + - {x: -0.044999998, y: 1.41} + - {x: -0.035, y: 1.66} + - {x: 0.48499998, y: 2.2} + - {x: 0.49499997, y: 2.48} + - {x: -1.3249999, y: 2.5} + - {x: -1.3249999, y: -2.5} + - {x: 0.505, y: -2.5} + - {x: 0.555, y: -2.12} + m_UseDelaunayMesh: 0 --- !u!1 &2171518497100337372 GameObject: m_ObjectHideFlags: 0 @@ -97,7 +164,8 @@ GameObject: m_Component: - component: {fileID: 1003080013996268193} - component: {fileID: 4856205316150460481} - m_Layer: 0 + - component: {fileID: 3931598674086383704} + m_Layer: 6 m_Name: Right_Tile1_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -174,6 +242,65 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!60 &3931598674086383704 +PolygonCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2171518497100337372} + m_Enabled: 1 + serializedVersion: 3 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_CompositeOperation: 0 + m_CompositeOrder: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 2.37, y: 5} + newSize: {x: 2.65, y: 5} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + m_Points: + m_Paths: + - - {x: -0.635, y: 2.5} + - {x: -0.835, y: 1.8499999} + - {x: -1.185, y: 1.42} + - {x: -1.185, y: 1.06} + - {x: -1.055, y: 0.69} + - {x: -0.185, y: -0.65999997} + - {x: -0.175, y: -0.78999996} + - {x: -0.585, y: -1.49} + - {x: -0.675, y: -2.08} + - {x: -0.635, y: -2.5} + - {x: 1.185, y: -2.5} + - {x: 1.185, y: 2.5} + m_UseDelaunayMesh: 0 --- !u!1 &2956826569642009690 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Minigames/DivingForPictures/Tile3.prefab b/Assets/Prefabs/Minigames/DivingForPictures/Tile3.prefab index 42766dba..2c8a383c 100644 --- a/Assets/Prefabs/Minigames/DivingForPictures/Tile3.prefab +++ b/Assets/Prefabs/Minigames/DivingForPictures/Tile3.prefab @@ -10,7 +10,8 @@ GameObject: m_Component: - component: {fileID: 7111145574660306503} - component: {fileID: 3889795708575321074} - m_Layer: 0 + - component: {fileID: 1709932086434338450} + m_Layer: 6 m_Name: Left_Tile2_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -87,6 +88,72 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!60 &1709932086434338450 +PolygonCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 864595161669782950} + m_Enabled: 1 + serializedVersion: 3 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_CompositeOperation: 0 + m_CompositeOrder: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 2.65, y: 5} + newSize: {x: 2.37, y: 5} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + m_Points: + m_Paths: + - - {x: 0.635, y: -1.78} + - {x: 0.585, y: -1.27} + - {x: 0.36499998, y: -1.14} + - {x: 0.415, y: -1.05} + - {x: 1.2149999, y: -0.85999995} + - {x: 1.3249999, y: -0.7} + - {x: 1.3249999, y: -0.35} + - {x: 1.145, y: -0.049999997} + - {x: 0.13499999, y: 0.45999998} + - {x: 0.275, y: 0.87} + - {x: 0.265, y: 1.0699999} + - {x: -0.044999998, y: 1.41} + - {x: -0.035, y: 1.66} + - {x: 0.48499998, y: 2.2} + - {x: 0.49499997, y: 2.48} + - {x: -1.3249999, y: 2.5} + - {x: -1.3249999, y: -2.5} + - {x: 0.505, y: -2.5} + - {x: 0.555, y: -2.12} + m_UseDelaunayMesh: 0 --- !u!1 &2171518497100337372 GameObject: m_ObjectHideFlags: 0 @@ -97,7 +164,8 @@ GameObject: m_Component: - component: {fileID: 1003080013996268193} - component: {fileID: 4856205316150460481} - m_Layer: 0 + - component: {fileID: 9036823987933958098} + m_Layer: 6 m_Name: Right_Tile1_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -174,6 +242,70 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!60 &9036823987933958098 +PolygonCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2171518497100337372} + m_Enabled: 1 + serializedVersion: 3 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_CompositeOperation: 0 + m_CompositeOrder: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 2.65, y: 5} + newSize: {x: 2.65, y: 5} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + m_Points: + m_Paths: + - - {x: -0.48499998, y: 2.5} + - {x: -0.49499997, y: 2.19} + - {x: 0.035, y: 1.66} + - {x: 0.035, y: 1.42} + - {x: -0.24499999, y: 1.15} + - {x: -0.285, y: 0.90999997} + - {x: -0.13499999, y: 0.45999998} + - {x: -1.115, y: -0.03} + - {x: -1.3249999, y: -0.35} + - {x: -1.3249999, y: -0.71} + - {x: -1.2049999, y: -0.84999996} + - {x: -0.36499998, y: -1.0699999} + - {x: -0.585, y: -1.27} + - {x: -0.625, y: -1.65} + - {x: -0.48499998, y: -2.5} + - {x: 1.3249999, y: -2.5} + - {x: 1.3249999, y: 2.5} + m_UseDelaunayMesh: 0 --- !u!1 &2956826569642009690 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Minigames/DivingForPictures/Tile3_flipped.prefab b/Assets/Prefabs/Minigames/DivingForPictures/Tile3_flipped.prefab index 35f0cb88..60f44546 100644 --- a/Assets/Prefabs/Minigames/DivingForPictures/Tile3_flipped.prefab +++ b/Assets/Prefabs/Minigames/DivingForPictures/Tile3_flipped.prefab @@ -10,7 +10,8 @@ GameObject: m_Component: - component: {fileID: 7111145574660306503} - component: {fileID: 3889795708575321074} - m_Layer: 0 + - component: {fileID: 6967660003360049346} + m_Layer: 6 m_Name: Left_Tile2_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -87,6 +88,72 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!60 &6967660003360049346 +PolygonCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 864595161669782950} + m_Enabled: 1 + serializedVersion: 3 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_CompositeOperation: 0 + m_CompositeOrder: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 2.65, y: 5} + newSize: {x: 2.37, y: 5} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + m_Points: + m_Paths: + - - {x: 0.635, y: -1.78} + - {x: 0.585, y: -1.27} + - {x: 0.36499998, y: -1.14} + - {x: 0.415, y: -1.05} + - {x: 1.2149999, y: -0.85999995} + - {x: 1.3249999, y: -0.7} + - {x: 1.3249999, y: -0.35} + - {x: 1.145, y: -0.049999997} + - {x: 0.13499999, y: 0.45999998} + - {x: 0.275, y: 0.87} + - {x: 0.265, y: 1.0699999} + - {x: -0.044999998, y: 1.41} + - {x: -0.035, y: 1.66} + - {x: 0.48499998, y: 2.2} + - {x: 0.49499997, y: 2.48} + - {x: -1.3249999, y: 2.5} + - {x: -1.3249999, y: -2.5} + - {x: 0.505, y: -2.5} + - {x: 0.555, y: -2.12} + m_UseDelaunayMesh: 0 --- !u!1 &2171518497100337372 GameObject: m_ObjectHideFlags: 0 @@ -97,7 +164,8 @@ GameObject: m_Component: - component: {fileID: 1003080013996268193} - component: {fileID: 4856205316150460481} - m_Layer: 0 + - component: {fileID: 5503039050943823342} + m_Layer: 6 m_Name: Right_Tile1_0 m_TagString: Untagged m_Icon: {fileID: 0} @@ -174,6 +242,70 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!60 &5503039050943823342 +PolygonCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2171518497100337372} + m_Enabled: 1 + serializedVersion: 3 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_CompositeOperation: 0 + m_CompositeOrder: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 2.65, y: 5} + newSize: {x: 2.65, y: 5} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + m_Points: + m_Paths: + - - {x: -0.48499998, y: 2.5} + - {x: -0.49499997, y: 2.19} + - {x: 0.035, y: 1.66} + - {x: 0.035, y: 1.42} + - {x: -0.24499999, y: 1.15} + - {x: -0.285, y: 0.90999997} + - {x: -0.13499999, y: 0.45999998} + - {x: -1.115, y: -0.03} + - {x: -1.3249999, y: -0.35} + - {x: -1.3249999, y: -0.71} + - {x: -1.2049999, y: -0.84999996} + - {x: -0.36499998, y: -1.0699999} + - {x: -0.585, y: -1.27} + - {x: -0.625, y: -1.65} + - {x: -0.48499998, y: -2.5} + - {x: 1.3249999, y: -2.5} + - {x: 1.3249999, y: 2.5} + m_UseDelaunayMesh: 0 --- !u!1 &2956826569642009690 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/MiniGames/DivingForPictures_obstaclebackup.unity b/Assets/Scenes/MiniGames/DivingForPictures_obstaclebackup.unity new file mode 100644 index 00000000..6b3ec021 --- /dev/null +++ b/Assets/Scenes/MiniGames/DivingForPictures_obstaclebackup.unity @@ -0,0 +1,2075 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &116234196 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 116234201} + - component: {fileID: 116234200} + - component: {fileID: 116234199} + - component: {fileID: 116234198} + - component: {fileID: 116234197} + m_Layer: 5 + m_Name: UI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &116234197 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 116234196} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5ec365b02ab496d8fa1d5f7d41a33e9, type: 3} + m_Name: + m_EditorClassIdentifier: + scoreText: {fileID: 1224833350} + scorePopupPrefab: {fileID: 0} + popupParent: {fileID: 0} +--- !u!114 &116234198 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 116234196} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &116234199 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 116234196} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &116234200 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 116234196} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &116234201 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 116234196} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1224833349} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &173052724 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 173052725} + - component: {fileID: 173052727} + - component: {fileID: 173052726} + m_Layer: 0 + m_Name: Rope2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &173052725 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 173052724} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2106431002} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &173052726 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 173052724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e2fcc597881599646a35e7161a5504ff, type: 3} + m_Name: + m_EditorClassIdentifier: + startPoint: {fileID: 730962733} + midPoint: {fileID: 0} + endPoint: {fileID: 2010418242} + linePoints: 10 + stiffness: 350 + damping: 15 + ropeLength: 2 + ropeWidth: 0.1 + midPointWeight: 1 + midPointPosition: 0.5 +--- !u!120 &173052727 +LineRenderer: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 173052724} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 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: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Positions: + - {x: 0, y: 4.1716814, z: 0} + - {x: -0.0011514801, y: 3.9187107, z: 0} + - {x: -0.00230296, y: 3.6922278, z: 0} + - {x: -0.0034544398, y: 3.4922323, z: 0} + - {x: -0.00460592, y: 3.3187256, z: 0} + - {x: -0.0057574, y: 3.1717062, z: 0} + - {x: -0.0069088796, y: 3.0511749, z: 0} + - {x: -0.008060359, y: 2.9571314, z: 0} + - {x: -0.00921184, y: 2.8895762, z: 0} + - {x: -0.010363319, y: 2.8485086, z: 0} + - {x: -0.0115148, y: 2.833929, z: 0} + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + textureScale: {x: 1, y: 1} + shadowBias: 0.5 + generateLightingData: 0 + m_MaskInteraction: 0 + m_UseWorldSpace: 1 + m_Loop: 0 + m_ApplyActiveColorSpace: 1 +--- !u!1 &224729330 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224729333} + - component: {fileID: 224729332} + m_Layer: 0 + m_Name: CinemachineCamera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &224729332 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 224729330} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f9dfa5b682dcd46bda6128250e975f58, type: 3} + m_Name: + m_EditorClassIdentifier: + Priority: + Enabled: 0 + m_Value: 0 + OutputChannel: 1 + StandbyUpdate: 2 + m_StreamingVersion: 20241001 + m_LegacyPriority: 0 + Target: + TrackingTarget: {fileID: 747976397} + LookAtTarget: {fileID: 0} + CustomLookAtTarget: 0 + Lens: + FieldOfView: 60 + OrthographicSize: 6.75 + 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 &224729333 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 224729330} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + 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 &424805724 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 424805726} + - component: {fileID: 424805725} + m_Layer: 0 + m_Name: MinigameManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &424805725 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 424805724} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4b2b072821054504b03fc4014b063153, type: 3} + m_Name: + m_EditorClassIdentifier: + monsterPrefabs: + - {fileID: 8508541779489709744, guid: cd5c27c38c427524988b8932e7205d81, type: 3} + - {fileID: 8588568014006713718, guid: 7c45910be7187144b8d2af12ff772353, type: 3} + - {fileID: 2665121316138540107, guid: c0d4b6d8a3b9a2447b883a78c568826c, type: 3} + - {fileID: 827631101927032693, guid: 5d23561cb618e86409a2b7ccbf08e37d, type: 3} + baseSpawnProbability: 0.2 + maxSpawnProbability: 0.5 + probabilityIncreaseRate: 0.01 + guaranteedSpawnTime: 10 + spawnCooldown: 5 + basePoints: 100 + depthMultiplier: 10 +--- !u!4 &424805726 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 424805724} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.22304, y: -2.01526, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &730962732 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 730962733} + - component: {fileID: 730962734} + - component: {fileID: 730962735} + - component: {fileID: 730962736} + m_Layer: 7 + m_Name: BottleSprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &730962733 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730962732} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 2.07, z: 0} + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 747976397} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &730962734 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730962732} + 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_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + 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: 0 + m_Sprite: {fileID: -8679947266657860767, guid: a6e77c94466133a488925fb29cb7b323, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 19.74, y: 12.53} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!60 &730962735 +PolygonCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730962732} + m_Enabled: 1 + serializedVersion: 3 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_CompositeOperation: 0 + m_CompositeOrder: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 19.74, y: 12.53} + newSize: {x: 19.74, y: 12.53} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + m_Points: + m_Paths: + - - {x: -2.59, y: -5.795} + - {x: -2.48, y: -6.105} + - {x: -2.1699998, y: -5.9449997} + - {x: -2.22, y: -5.765} + - {x: -2.4099998, y: -5.565} + - {x: -2.48, y: -5.305} + - {x: 1.9699999, y: -5.225} + - {x: 2.95, y: -4.9849997} + - {x: 3.77, y: -4.525} + - {x: 4.62, y: -3.745} + - {x: 5.1, y: -3.135} + - {x: 5.56, y: -2.245} + - {x: 6.1299996, y: -2.125} + - {x: 6.5499997, y: -2.155} + - {x: 6.68, y: -2.235} + - {x: 6.95, y: -2.855} + - {x: 7.21, y: -3.0549998} + - {x: 8.3, y: -3.0549998} + - {x: 8.79, y: -2.965} + - {x: 9.19, y: -2.7849998} + - {x: 9.5199995, y: -2.315} + - {x: 9.679999, y: -1.735} + - {x: 9.86, y: -0.13499999} + - {x: 9.7699995, y: 1.875} + - {x: 9.58, y: 2.905} + - {x: 9.349999, y: 3.455} + - {x: 8.94, y: 3.715} + - {x: 8.5199995, y: 3.8149998} + - {x: 7.8599997, y: 3.895} + - {x: 7.0299997, y: 3.875} + - {x: 6.91, y: 3.7849998} + - {x: 6.64, y: 2.915} + - {x: 6.15, y: 2.835} + - {x: 5.68, y: 2.925} + - {x: 5.54, y: 2.985} + - {x: 5.19, y: 3.645} + - {x: 4.69, y: 4.355} + - {x: 3.8, y: 5.225} + - {x: 2.95, y: 5.725} + - {x: 1.9, y: 5.9449997} + - {x: -2.49, y: 6.025} + - {x: -2.71, y: 6.2549996} + - {x: -3, y: 6.205} + - {x: -3.12, y: 6.035} + - {x: -7.22, y: 6.045} + - {x: -7.7599998, y: 5.935} + - {x: -8.21, y: 5.685} + - {x: -8.61, y: 5.325} + - {x: -8.99, y: 4.795} + - {x: -9.37, y: 3.975} + - {x: -9.62, y: 3.085} + - {x: -9.82, y: 1.635} + - {x: -9.86, y: -0.035} + - {x: -9.76, y: -1.3349999} + - {x: -9.55, y: -2.575} + - {x: -9.389999, y: -3.135} + - {x: -8.92, y: -4.165} + - {x: -8.389999, y: -4.815} + - {x: -7.64, y: -5.245} + - {x: -7.14, y: -5.335} + - {x: -3.03, y: -5.315} + - {x: -3.08, y: -5.545} + - {x: -2.99, y: -5.775} + - {x: -3.23, y: -6.145} + - {x: -2.86, y: -6.265} + - {x: -2.6699998, y: -5.955} + m_UseDelaunayMesh: 0 +--- !u!114 &730962736 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 730962732} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d8ea29cc80524de8affe17b930cd75c1, type: 3} + m_Name: + m_EditorClassIdentifier: + damageBlinkColor: {r: 1, g: 0, b: 0, a: 1} + blinkRate: 0.15 + damageColorAlpha: 0.7 + targetSpriteRenderer: {fileID: 730962734} +--- !u!1 &747976396 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 747976397} + - component: {fileID: 747976398} + - component: {fileID: 747976399} + - component: {fileID: 747976400} + m_Layer: 7 + m_Name: BottleMarine + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &747976397 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 747976396} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 2.9799, z: 0} + m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 730962733} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &747976398 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 747976396} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d39dbaae819c4a128a11ca60fbbc98c9, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &747976399 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 747976396} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9072050a53fc4b539f4f4716bab53c07, type: 3} + m_Name: + m_EditorClassIdentifier: + wobbleFrequency: 1.5 + baseWobbleAmplitude: 8 + speedToAmplitude: 2 + maxRotationLimit: 45 + verticalFrequency: 0.5 + verticalAmplitude: 0.2 + velocitySmoothing: 10 + rotationSmoothing: 10 +<<<<<<< HEAD +--- !u!1 &824396214 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 824396217} + - component: {fileID: 824396216} + - component: {fileID: 824396215} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &824396215 +======= +--- !u!114 &747976400 +>>>>>>> 7c4970b (Working state for minigameobstacles) +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} +<<<<<<< HEAD + m_GameObject: {fileID: 824396214} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_MoveRepeatDelay: 0.5 + m_MoveRepeatRate: 0.1 + m_XRTrackingOrigin: {fileID: 0} + m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_DeselectOnBackgroundClick: 1 + m_PointerBehavior: 0 + m_CursorLockBehavior: 0 + m_ScrollDeltaPerTick: 6 +--- !u!114 &824396216 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 824396214} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &824396217 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 824396214} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +======= + m_GameObject: {fileID: 747976396} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8222f0e3aeeb4fc4975aaead6cf7afbe, type: 3} + m_Name: + m_EditorClassIdentifier: + damageImmunityDuration: 1 + obstacleLayerMask: + serializedVersion: 2 + m_Bits: 64 + blockInputDuringImmunity: 0 + playerCharacter: {fileID: 747976396} + playerController: {fileID: 747976398} + bumpMode: 0 + bumpForce: 4 + smoothMoveSpeed: 10 + bumpCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 2 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + blockInputDuringBump: 1 +>>>>>>> 7c4970b (Working state for minigameobstacles) +--- !u!1 &1003335103 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1003335105} + - component: {fileID: 1003335104} + m_Layer: 0 + m_Name: BubbleSpawner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1003335104 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1003335103} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1f047af2457745158162344fe19c3477, type: 3} + m_Name: + m_EditorClassIdentifier: + bubblePrefab: {fileID: 8114503068028241010, guid: e7a40dc74a6c9564ebdda2c7ebd6b975, type: 3} + bubbleSprites: + - {fileID: -1935083779452269832, guid: 33e6f5fe26a891e4da5d6bfd9125a8fa, type: 3} + - {fileID: -3448220263590106980, guid: 3c68df10bb6cd72428ec4160e15deeaf, type: 3} + - {fileID: 8773148034285304506, guid: cba81aa25acbe564cb363782f87c988a, type: 3} + - {fileID: -5093844878195686178, guid: eb62213ffae1fa242bcf16e696d9324f, type: 3} + - {fileID: 8944853044452083345, guid: 4ad95f797558b28478685ca60bd90ff4, type: 3} + spawnInterval: 0.5 + speedRange: {x: 0.5, y: 2} + scaleRange: {x: 0.8, y: 1.2} + wobbleSpeedRange: {x: 0.2, y: 1} + wobbleAmountRange: {x: 0.05, y: 0.15} + spawnXMin: -3.5 + spawnXMax: 3.5 + spawnY: -6.78 + wobbleMinScale: 0.5 + wobbleMaxScale: 1.2 + useObjectPooling: 1 + initialPoolSize: 10 + maxPoolSize: 30 +--- !u!4 &1003335105 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1003335103} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0, y: -6.78, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1062017693 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1062017694} + - component: {fileID: 1062017696} + - component: {fileID: 1062017695} + m_Layer: 0 + m_Name: Rope3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1062017694 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1062017693} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2106431002} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1062017695 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1062017693} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e2fcc597881599646a35e7161a5504ff, type: 3} + m_Name: + m_EditorClassIdentifier: + startPoint: {fileID: 730962733} + midPoint: {fileID: 0} + endPoint: {fileID: 1266665688} + linePoints: 10 + stiffness: 350 + damping: 15 + ropeLength: 2 + ropeWidth: 0.1 + midPointWeight: 1 + midPointPosition: 0.5 +--- !u!120 &1062017696 +LineRenderer: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1062017693} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 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: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Positions: + - {x: 0, y: 4.1716814, z: 0} + - {x: 0.036271624, y: 3.927396, z: 0} + - {x: 0.07254324, y: 3.7076683, z: 0} + - {x: 0.10881486, y: 3.5124984, z: 0} + - {x: 0.14508648, y: 3.3418865, z: 0} + - {x: 0.1813581, y: 3.195832, z: 0} + - {x: 0.21762972, y: 3.0743358, z: 0} + - {x: 0.25390133, y: 2.9773972, z: 0} + - {x: 0.29017296, y: 2.905017, z: 0} + - {x: 0.32644457, y: 2.857194, z: 0} + - {x: 0.3627162, y: 2.833929, z: 0} + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: -1 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + textureScale: {x: 1, y: 1} + shadowBias: 0.5 + generateLightingData: 0 + m_MaskInteraction: 0 + m_UseWorldSpace: 1 + m_Loop: 0 + m_ApplyActiveColorSpace: 1 +--- !u!1 &1063641111 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1063641114} + - component: {fileID: 1063641113} + - component: {fileID: 1063641112} + - component: {fileID: 1063641115} + - component: {fileID: 1063641116} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1063641112 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1063641111} + m_Enabled: 1 +--- !u!20 &1063641113 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1063641111} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 6.75 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1063641114 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1063641111} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + 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!114 &1063641115 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1063641111} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 72ece51f2901e7445ab60da3685d6b5f, type: 3} + m_Name: + m_EditorClassIdentifier: + ShowDebugText: 0 + ShowCameraFrustum: 1 + IgnoreTimeScale: 0 + WorldUpOverride: {fileID: 0} + ChannelMask: -1 + UpdateMethod: 2 + BlendUpdateMethod: 1 + LensModeOverride: + Enabled: 0 + DefaultMode: 2 + DefaultBlend: + Style: 1 + Time: 2 + CustomCurve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + CustomBlends: {fileID: 0} +<<<<<<< HEAD +--- !u!1 &1224833348 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1224833349} + - component: {fileID: 1224833351} + - component: {fileID: 1224833350} + m_Layer: 5 + m_Name: ScoreDisplay + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1224833349 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1224833348} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 116234201} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -81, y: -76} + m_SizeDelta: {x: 245.4807, y: 78.4255} + m_Pivot: {x: 1, y: 1} +--- !u!114 &1224833350 +======= +--- !u!114 &1063641116 +>>>>>>> 7c4970b (Working state for minigameobstacles) +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} +<<<<<<< HEAD + m_GameObject: {fileID: 1224833348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: New Text + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 50 + m_fontSizeBase: 50 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 0 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1224833351 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1224833348} + m_CullTransparentMesh: 1 +======= + m_GameObject: {fileID: 1063641111} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_AllowHDROutput: 1 + m_UseScreenCoordOverride: 0 + m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0} + m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0} + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 + m_TaaSettings: + m_Quality: 3 + m_FrameInfluence: 0.1 + m_JitterScale: 1 + m_MipBias: 0 + m_VarianceClampScale: 0.9 + m_ContrastAdaptiveSharpening: 0 +>>>>>>> 7c4970b (Working state for minigameobstacles) +--- !u!1 &1266665687 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1266665688} + m_Layer: 0 + m_Name: RopeAttachPoint3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1266665688 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1266665687} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.63, y: 0.58, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2106431002} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1435210807 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1435210808} + - component: {fileID: 1435210810} + - component: {fileID: 1435210809} + - component: {fileID: 1435210811} + m_Layer: 0 + m_Name: Rope1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1435210808 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1435210807} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2106431002} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1435210809 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1435210807} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e2fcc597881599646a35e7161a5504ff, type: 3} + m_Name: + m_EditorClassIdentifier: + startPoint: {fileID: 730962733} + midPoint: {fileID: 0} + endPoint: {fileID: 1916796530} + linePoints: 10 + stiffness: 350 + damping: 15 + ropeLength: 2 + ropeWidth: 0.1 + midPointWeight: 1 + midPointPosition: 0.5 +--- !u!120 &1435210810 +LineRenderer: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1435210807} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 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: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Positions: + - {x: 0, y: 4.1716814, z: 0} + - {x: -0.03339292, y: 3.9260902, z: 0} + - {x: -0.066785835, y: 3.705347, z: 0} + - {x: -0.10017875, y: 3.5094519, z: 0} + - {x: -0.13357168, y: 3.3384047, z: 0} + - {x: -0.16696459, y: 3.1922054, z: 0} + - {x: -0.20035751, y: 3.0708542, z: 0} + - {x: -0.2337504, y: 2.9743507, z: 0} + - {x: -0.26714337, y: 2.9026957, z: 0} + - {x: -0.30053627, y: 2.8558884, z: 0} + - {x: -0.33392918, y: 2.833929, z: 0} + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 0.4245283, g: 0.089180216, b: 0, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + textureScale: {x: 1, y: 1} + shadowBias: 0.5 + generateLightingData: 0 + m_MaskInteraction: 0 + m_UseWorldSpace: 1 + m_Loop: 0 + m_ApplyActiveColorSpace: 1 +--- !u!23 &1435210811 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1435210807} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 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: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1679185997 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1679185998} + - component: {fileID: 1679185999} + m_Layer: 0 + m_Name: TileSpawner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1679185998 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1679185997} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1679185999 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1679185997} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fbe5f5d548d44d93b3f90be6542205d8, type: 3} + m_Name: + m_EditorClassIdentifier: + tilePrefabs: + - {fileID: 2956826569642009690, guid: 661c5018e2409034d92de025b7ac57b7, type: 3} + - {fileID: 2956826569642009690, guid: c24515e40c664f645bdef28a10d1b882, type: 3} + - {fileID: 2956826569642009690, guid: 4827a98c801e6ea42a9ac44eb9c176ff, type: 3} + - {fileID: 2956826569642009690, guid: 43ed47cbe958b9f46b462e2fca2382c5, type: 3} + - {fileID: 2956826569642009690, guid: 4f772f2aebd38b44ca31063d196c77c1, type: 3} + - {fileID: 2956826569642009690, guid: 7f7f10ca24a5afe46be797daea64111a, type: 3} + initialTileCount: 3 + tileSpawnBuffer: 1 + moveSpeed: 3 + speedUpFactor: 0 + speedUpInterval: 0 + maxMoveSpeed: 12 + useObjectPooling: 1 + maxPerPrefabPoolSize: 2 + totalMaxPoolSize: 25 + onTileSpawned: + m_PersistentCalls: + m_Calls: [] + onTileDestroyed: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &1834056336 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1834056337} + - component: {fileID: 1834056338} + m_Layer: 0 + m_Name: RockSprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1834056337 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1834056336} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 2106431002} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1834056338 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1834056336} + 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_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + 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: 0 + m_Sprite: {fileID: 3452003437791708593, guid: 4c13556eeb918624c9dd3d7e4086242e, 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.56, y: 2.56} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1916796529 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1916796530} + m_Layer: 0 + m_Name: RopeAttachPoint1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1916796530 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1916796529} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.58, y: 0.58, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2106431002} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2010418241 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2010418242} + m_Layer: 0 + m_Name: RopeAttachPoint2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2010418242 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2010418241} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.02, y: 0.58, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2106431002} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2106431001 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2106431002} + - component: {fileID: 2106431003} + - component: {fileID: 2106431004} + m_Layer: 0 + m_Name: Rock + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2106431002 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2106431001} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 2.5, z: 0} + m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1834056337} + - {fileID: 1435210808} + - {fileID: 173052725} + - {fileID: 1062017694} + - {fileID: 1916796530} + - {fileID: 2010418242} + - {fileID: 1266665688} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2106431003 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2106431001} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f1a7937fe5974e9486dc7545de8cee6b, type: 3} + m_Name: + m_EditorClassIdentifier: + bottleTransform: {fileID: 747976397} + bottleWobble: {fileID: 747976399} + followStiffness: 4 + useWobbleOffset: 1 + baseY: 2.5 +--- !u!114 &2106431004 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2106431001} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9072050a53fc4b539f4f4716bab53c07, type: 3} + m_Name: + m_EditorClassIdentifier: + wobbleFrequency: 1.5 + baseWobbleAmplitude: 8 + speedToAmplitude: 2 + maxRotationLimit: 45 + verticalFrequency: 0.5 + verticalAmplitude: 0.5 + velocitySmoothing: 10 + rotationSmoothing: 10 +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1063641114} + - {fileID: 224729333} + - {fileID: 747976397} + - {fileID: 1003335105} + - {fileID: 2106431002} + - {fileID: 1679185998} + - {fileID: 424805726} + - {fileID: 116234201} + - {fileID: 824396217} diff --git a/Assets/Scripts/Minigames/DivingForPictures/FloatingObstacle.cs b/Assets/Scripts/Minigames/DivingForPictures/FloatingObstacle.cs new file mode 100644 index 00000000..67bb347a --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/FloatingObstacle.cs @@ -0,0 +1,233 @@ +using UnityEngine; +using Pooling; + +namespace Minigames.DivingForPictures +{ + /// + /// Complete floating obstacle component that handles data, movement, collision detection, and pooling. + /// Obstacles move upward toward the surface and detect collisions with the player. + /// + public class FloatingObstacle : MonoBehaviour, IPoolable + { + [Header("Obstacle Properties")] + [Tooltip("Index of the prefab this obstacle was created from")] + [SerializeField] private int prefabIndex; + + [Tooltip("Damage this obstacle deals to the player")] + [SerializeField] private float damage = 1f; + + [Tooltip("Movement speed of this obstacle")] + [SerializeField] private float moveSpeed = 2f; + + [Header("Movement")] + [Tooltip("Whether this obstacle moves (can be disabled for static obstacles)")] + [SerializeField] private bool enableMovement = true; + + [Header("Collision Detection")] + [Tooltip("Layer mask for player detection - should match Player layer")] + [SerializeField] private LayerMask playerLayerMask = 1 << 7; // Player layer + + [Tooltip("How often to check for collisions (in seconds)")] + [SerializeField] private float collisionCheckInterval = 0.1f; + + [Header("References")] + [Tooltip("Reference to the spawner that created this obstacle")] + [SerializeField] private ObstacleSpawner spawner; + + // Public properties + public int PrefabIndex + { + get => prefabIndex; + set => prefabIndex = value; + } + + public float Damage + { + get => damage; + set => damage = value; + } + + public float MoveSpeed + { + get => moveSpeed; + set => moveSpeed = value; + } + + public bool HasDealtDamage => _hasDealtDamage; + + // Private fields + private Collider2D _collider; + private float _collisionCheckTimer; + private bool _hasDealtDamage; + private Camera _mainCamera; + private float _screenTop; + + private void Awake() + { + _collider = GetComponent(); + + if (_collider == null) + { + _collider = GetComponentInChildren(); + } + + if (_collider == null) + { + Debug.LogError($"[FloatingObstacle] No Collider2D found on {gameObject.name}!"); + } + + _mainCamera = Camera.main; + } + + private void Update() + { + if (enableMovement) + { + HandleMovement(); + } + + HandleCollisionDetection(); + CheckIfOffScreen(); + } + + /// + /// Moves the obstacle upward based on its speed + /// + private void HandleMovement() + { + transform.position += Vector3.up * (moveSpeed * Time.deltaTime); + } + + /// + /// Checks for collisions with the player at regular intervals + /// + private void HandleCollisionDetection() + { + if (_hasDealtDamage || _collider == null) return; + + _collisionCheckTimer -= Time.deltaTime; + if (_collisionCheckTimer <= 0f) + { + _collisionCheckTimer = collisionCheckInterval; + CheckForPlayerCollision(); + } + } + + /// + /// Checks if this obstacle is colliding with the player + /// + private void CheckForPlayerCollision() + { + Collider2D[] overlapping = new Collider2D[5]; + ContactFilter2D filter = new ContactFilter2D(); + filter.SetLayerMask(playerLayerMask); + filter.useTriggers = true; + + int count = _collider.Overlap(filter, overlapping); + + if (count > 0 && !_hasDealtDamage) + { + // Found collision with player + OnPlayerCollision(overlapping[0]); + } + } + + /// + /// Called when this obstacle collides with the player + /// + /// The player's collider + private void OnPlayerCollision(Collider2D playerCollider) + { + _hasDealtDamage = true; + + // Trigger damage through events (following the existing pattern) + Debug.Log($"[FloatingObstacle] Obstacle dealt {damage} damage to player"); + + // Broadcast damage event using the static method + PlayerCollisionBehavior.TriggerDamageStart(); + + // Continue moving upward - don't destroy or stop the obstacle + Debug.Log($"[FloatingObstacle] Obstacle {gameObject.name} hit player and continues moving"); + } + + /// + /// Checks if the obstacle has moved off-screen and should be despawned + /// + private void CheckIfOffScreen() + { + if (_mainCamera == null) return; + + // Calculate screen top if not cached + if (_screenTop == 0f) + { + Vector3 topWorldPoint = _mainCamera.ViewportToWorldPoint(new Vector3(0.5f, 1f, _mainCamera.nearClipPlane)); + _screenTop = topWorldPoint.y; + } + + // Check if obstacle is above screen + if (transform.position.y > _screenTop + 2f) // Extra buffer for safety + { + ReturnToPool(); + } + } + + /// + /// Returns this obstacle to the spawner's pool + /// + private void ReturnToPool() + { + if (spawner != null) + { + spawner.ReturnObstacleToPool(gameObject, prefabIndex); + } + else + { + Debug.LogWarning($"[FloatingObstacle] Cannot return {gameObject.name} to pool - missing spawner reference"); + Destroy(gameObject); + } + } + + /// + /// Sets the spawner reference for this obstacle + /// + /// The spawner that created this obstacle + public void SetSpawner(ObstacleSpawner obstacleSpawner) + { + spawner = obstacleSpawner; + } + + /// + /// Called when the obstacle is retrieved from the pool + /// + public void OnSpawn() + { + _hasDealtDamage = false; + _collisionCheckTimer = 0f; + _screenTop = 0f; // Reset cached screen bounds + + // Ensure the obstacle is active and visible + gameObject.SetActive(true); + + Debug.Log($"[FloatingObstacle] Obstacle {gameObject.name} spawned"); + } + + /// + /// Called when the obstacle is returned to the pool + /// + public void OnDespawn() + { + _hasDealtDamage = false; + _collisionCheckTimer = 0f; + + Debug.Log($"[FloatingObstacle] Obstacle {gameObject.name} despawned"); + } + + /// + /// Public method to manually trigger return to pool (for external systems) + /// + public void ForceReturnToPool() + { + ReturnToPool(); + } + } +} diff --git a/Assets/Scripts/Minigames/DivingForPictures/FloatingObstacle.cs.meta b/Assets/Scripts/Minigames/DivingForPictures/FloatingObstacle.cs.meta new file mode 100644 index 00000000..89513a32 --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/FloatingObstacle.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 32718083aef44be2a4318681fcdf5b2e +timeCreated: 1758117709 \ No newline at end of file diff --git a/Assets/Scripts/Minigames/DivingForPictures/ObstaclePool.cs b/Assets/Scripts/Minigames/DivingForPictures/ObstaclePool.cs new file mode 100644 index 00000000..25b8edf8 --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/ObstaclePool.cs @@ -0,0 +1,44 @@ +using UnityEngine; +using Pooling; + +namespace Minigames.DivingForPictures +{ + /// + /// Manages a pool of floating obstacle objects to reduce garbage collection overhead. + /// Optimized for handling a large number of different obstacle prefab types. + /// + public class ObstaclePool : MultiPrefabPool + { + /// + /// Returns an obstacle to the pool + /// + /// The obstacle to return to the pool + /// The index of the prefab this obstacle was created from + public void ReturnObstacle(GameObject obstacle, int prefabIndex) + { + if (obstacle != null) + { + FloatingObstacle obstacleComponent = obstacle.GetComponent(); + if (obstacleComponent != null) + { + Return(obstacleComponent, prefabIndex); + } + else + { + Debug.LogWarning($"Attempted to return a GameObject without a FloatingObstacle component: {obstacle.name}"); + Destroy(obstacle); + } + } + } + + /// + /// Gets an obstacle from the pool, or creates a new one if the pool is empty + /// + /// An obstacle instance ready to use + public GameObject GetObstacle(int prefabIndex) + { + FloatingObstacle obstacleComponent = Get(prefabIndex); + return obstacleComponent.gameObject; + } + } +} diff --git a/Assets/Scripts/Minigames/DivingForPictures/ObstaclePool.cs.meta b/Assets/Scripts/Minigames/DivingForPictures/ObstaclePool.cs.meta new file mode 100644 index 00000000..230d34ab --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/ObstaclePool.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a53ba79246a94dc4a71d2fb0d7214cfb +timeCreated: 1758116804 \ No newline at end of file diff --git a/Assets/Scripts/Minigames/DivingForPictures/ObstacleSpawner.cs b/Assets/Scripts/Minigames/DivingForPictures/ObstacleSpawner.cs new file mode 100644 index 00000000..717940ff --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/ObstacleSpawner.cs @@ -0,0 +1,452 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Events; +using Pooling; + +namespace Minigames.DivingForPictures +{ + /// + /// Spawns and manages mobile obstacles for the diving minigame. + /// Uses object pooling and validates spawn positions to avoid colliding with tiles. + /// + public class ObstacleSpawner : MonoBehaviour + { + [Header("Obstacle Prefabs")] + [Tooltip("List of possible obstacle prefabs to spawn")] + [SerializeField] private List obstaclePrefabs; + + [Header("Spawn Settings")] + [Tooltip("Time interval between spawn attempts (in seconds)")] + [SerializeField] private float spawnInterval = 2f; + + [Tooltip("Random variation in spawn timing (+/- seconds)")] + [SerializeField] private float spawnIntervalVariation = 0.5f; + + [Tooltip("Maximum number of spawn position attempts before skipping")] + [SerializeField] private int maxSpawnAttempts = 10; + + [Tooltip("Radius around spawn point to check for tile collisions")] + [SerializeField] private float spawnCollisionRadius = 1f; + + [Header("Spawn Position")] + [Tooltip("How far below screen to spawn obstacles")] + [SerializeField] private float spawnDistanceBelowScreen = 2f; + + [Tooltip("Horizontal spawn range (distance from center)")] + [SerializeField] private float spawnRangeX = 8f; + + [Header("Obstacle Properties Randomization")] + [Tooltip("Minimum movement speed for spawned obstacles")] + [SerializeField] private float minMoveSpeed = 1f; + + [Tooltip("Maximum movement speed for spawned obstacles")] + [SerializeField] private float maxMoveSpeed = 4f; + + [Tooltip("Minimum damage dealt by obstacles")] + [SerializeField] private float minDamage = 0.5f; + + [Tooltip("Maximum damage dealt by obstacles")] + [SerializeField] private float maxDamage = 2f; + + [Header("Object Pooling")] + [Tooltip("Whether to use object pooling for obstacles")] + [SerializeField] private bool useObjectPooling = true; + + [Tooltip("Maximum objects per prefab type in pool")] + [SerializeField] private int maxPerPrefabPoolSize = 3; + + [Tooltip("Total maximum pool size across all prefab types")] + [SerializeField] private int totalMaxPoolSize = 15; + + [Header("Layer Settings")] + [Tooltip("Layer mask for tile collision detection - should match WorldObstacle layer")] + [SerializeField] private LayerMask tileLayerMask = 1 << 6; // WorldObstacle layer + + [Header("Events")] + [Tooltip("Called when an obstacle is spawned")] + public UnityEvent onObstacleSpawned; + + [Tooltip("Called when an obstacle is returned to pool")] + public UnityEvent onObstacleDestroyed; + + // Private fields + private ObstaclePool _obstaclePool; + private Camera _mainCamera; + private float _screenBottom; + private Coroutine _spawnCoroutine; + private readonly List _activeObstacles = new List(); + + private void Awake() + { + _mainCamera = Camera.main; + + // Validate obstacle prefabs + ValidateObstaclePrefabs(); + + if (useObjectPooling) + { + InitializeObjectPool(); + } + } + + private void Start() + { + CalculateScreenBounds(); + StartSpawning(); + } + + private void OnDestroy() + { + StopSpawning(); + } + + /// + /// Validates that all prefabs have required components + /// + private void ValidateObstaclePrefabs() + { + for (int i = 0; i < obstaclePrefabs.Count; i++) + { + if (obstaclePrefabs[i] == null) continue; + + // Check if the prefab has a FloatingObstacle component + if (obstaclePrefabs[i].GetComponent() == null) + { + Debug.LogWarning($"Obstacle prefab {obstaclePrefabs[i].name} does not have a FloatingObstacle component. Adding one automatically."); + obstaclePrefabs[i].AddComponent(); + } + + // Ensure the prefab is on the correct layer + if (obstaclePrefabs[i].layer != 11) // QuarryObstacle layer + { + Debug.LogWarning($"Obstacle prefab {obstaclePrefabs[i].name} is not on QuarryObstacle layer (11). Setting layer automatically."); + SetLayerRecursively(obstaclePrefabs[i], 11); + } + } + } + + /// + /// Sets the layer of a GameObject and all its children + /// + private void SetLayerRecursively(GameObject obj, int layer) + { + obj.layer = layer; + foreach (Transform child in obj.transform) + { + SetLayerRecursively(child.gameObject, layer); + } + } + + /// + /// Initialize the object pool system + /// + private void InitializeObjectPool() + { + GameObject poolGO = new GameObject("ObstaclePool"); + poolGO.transform.SetParent(transform); + _obstaclePool = poolGO.AddComponent(); + + // Set up pool configuration + _obstaclePool.maxPerPrefabPoolSize = maxPerPrefabPoolSize; + _obstaclePool.totalMaxPoolSize = totalMaxPoolSize; + + // Convert GameObject list to FloatingObstacle list + List prefabObstacles = new List(obstaclePrefabs.Count); + foreach (var prefab in obstaclePrefabs) + { + if (prefab != null) + { + FloatingObstacle obstacleComponent = prefab.GetComponent(); + if (obstacleComponent != null) + { + prefabObstacles.Add(obstacleComponent); + } + else + { + Debug.LogError($"Obstacle prefab {prefab.name} is missing a FloatingObstacle component!"); + } + } + } + + // Initialize the pool + _obstaclePool.Initialize(prefabObstacles); + + // Periodically trim the pool + InvokeRepeating(nameof(TrimExcessPooledObstacles), 15f, 30f); + } + + /// + /// Calculate screen bounds in world space + /// + private void CalculateScreenBounds() + { + if (_mainCamera == null) + { + _mainCamera = Camera.main; + if (_mainCamera == null) + { + Debug.LogError("[ObstacleSpawner] No main camera found!"); + return; + } + } + + Vector3 bottomWorldPoint = _mainCamera.ViewportToWorldPoint(new Vector3(0.5f, 0f, _mainCamera.nearClipPlane)); + _screenBottom = bottomWorldPoint.y; + } + + /// + /// Starts the obstacle spawning coroutine + /// + public void StartSpawning() + { + if (_spawnCoroutine == null) + { + _spawnCoroutine = StartCoroutine(SpawnObstaclesCoroutine()); + Debug.Log("[ObstacleSpawner] Started spawning obstacles"); + } + } + + /// + /// Stops the obstacle spawning coroutine + /// + public void StopSpawning() + { + if (_spawnCoroutine != null) + { + StopCoroutine(_spawnCoroutine); + _spawnCoroutine = null; + Debug.Log("[ObstacleSpawner] Stopped spawning obstacles"); + } + } + + /// + /// Main spawning coroutine that runs continuously + /// + private IEnumerator SpawnObstaclesCoroutine() + { + while (true) + { + // Calculate next spawn time with variation + float nextSpawnTime = spawnInterval + Random.Range(-spawnIntervalVariation, spawnIntervalVariation); + nextSpawnTime = Mathf.Max(0.1f, nextSpawnTime); // Ensure minimum interval + + yield return new WaitForSeconds(nextSpawnTime); + + // Attempt to spawn an obstacle + TrySpawnObstacle(); + } + } + + /// + /// Attempts to spawn an obstacle at a valid position + /// + private void TrySpawnObstacle() + { + if (obstaclePrefabs == null || obstaclePrefabs.Count == 0) + { + Debug.LogWarning("[ObstacleSpawner] No obstacle prefabs available for spawning!"); + return; + } + + Vector3 spawnPosition; + bool foundValidPosition = false; + + // Try to find a valid spawn position + for (int attempts = 0; attempts < maxSpawnAttempts; attempts++) + { + spawnPosition = GetRandomSpawnPosition(); + + if (IsValidSpawnPosition(spawnPosition)) + { + SpawnObstacleAt(spawnPosition); + foundValidPosition = true; + break; + } + } + + if (!foundValidPosition) + { + Debug.Log($"[ObstacleSpawner] Could not find valid spawn position after {maxSpawnAttempts} attempts"); + } + } + + /// + /// Gets a random spawn position below the screen + /// + private Vector3 GetRandomSpawnPosition() + { + float randomX = Random.Range(-spawnRangeX, spawnRangeX); + float spawnY = _screenBottom - spawnDistanceBelowScreen; + + return new Vector3(randomX, spawnY, 0f); + } + + /// + /// Checks if a spawn position is valid (not colliding with tiles) + /// + private bool IsValidSpawnPosition(Vector3 position) + { + // Use OverlapCircle to check for collisions with tiles + Collider2D collision = Physics2D.OverlapCircle(position, spawnCollisionRadius, tileLayerMask); + return collision == null; + } + + /// + /// Spawns an obstacle at the specified position + /// + private void SpawnObstacleAt(Vector3 position) + { + // Select random prefab + int prefabIndex = Random.Range(0, obstaclePrefabs.Count); + GameObject prefab = obstaclePrefabs[prefabIndex]; + + if (prefab == null) + { + Debug.LogError($"[ObstacleSpawner] Obstacle prefab at index {prefabIndex} is null!"); + return; + } + + GameObject obstacle; + + // Spawn using pool or instantiate directly + if (useObjectPooling && _obstaclePool != null) + { + obstacle = _obstaclePool.GetObstacle(prefabIndex); + if (obstacle == null) + { + Debug.LogError("[ObstacleSpawner] Failed to get obstacle from pool!"); + return; + } + + obstacle.transform.position = position; + obstacle.transform.rotation = prefab.transform.rotation; + obstacle.transform.SetParent(transform); + } + else + { + obstacle = Instantiate(prefab, position, prefab.transform.rotation, transform); + } + + // Configure the obstacle + ConfigureObstacle(obstacle, prefabIndex); + + // Track active obstacles + _activeObstacles.Add(obstacle); + + // Invoke events + onObstacleSpawned?.Invoke(obstacle); + + Debug.Log($"[ObstacleSpawner] Spawned obstacle {obstacle.name} at {position}"); + } + + /// + /// Configures an obstacle with randomized properties + /// + private void ConfigureObstacle(GameObject obstacle, int prefabIndex) + { + FloatingObstacle obstacleComponent = obstacle.GetComponent(); + if (obstacleComponent != null) + { + // Set prefab index + obstacleComponent.PrefabIndex = prefabIndex; + + // Randomize properties + obstacleComponent.MoveSpeed = Random.Range(minMoveSpeed, maxMoveSpeed); + obstacleComponent.Damage = Random.Range(minDamage, maxDamage); + + // Set spawner reference (since FloatingObstacle has this built-in now) + obstacleComponent.SetSpawner(this); + } + } + + /// + /// Returns an obstacle to the pool (called by FloatingObstacle) + /// + public void ReturnObstacleToPool(GameObject obstacle, int prefabIndex) + { + if (obstacle == null) return; + + // Remove from active list + _activeObstacles.Remove(obstacle); + + // Invoke events + onObstacleDestroyed?.Invoke(obstacle); + + // Return to pool or destroy + if (useObjectPooling && _obstaclePool != null) + { + _obstaclePool.ReturnObstacle(obstacle, prefabIndex); + } + else + { + Destroy(obstacle); + } + } + + /// + /// Called periodically to trim excess pooled obstacles + /// + private void TrimExcessPooledObstacles() + { + if (_obstaclePool != null) + { + _obstaclePool.TrimExcess(); + } + } + + /// + /// Public method to change spawn interval at runtime + /// + public void SetSpawnInterval(float interval) + { + spawnInterval = interval; + } + + /// + /// Public method to change spawn range at runtime + /// + public void SetSpawnRange(float range) + { + spawnRangeX = range; + } + + /// + /// Public method to set speed range at runtime + /// + public void SetSpeedRange(float min, float max) + { + minMoveSpeed = min; + maxMoveSpeed = max; + } + + /// + /// Public method to set damage range at runtime + /// + public void SetDamageRange(float min, float max) + { + minDamage = min; + maxDamage = max; + } + + /// + /// Gets the count of currently active obstacles + /// + public int ActiveObstacleCount => _activeObstacles.Count; + +#if UNITY_EDITOR + private void OnDrawGizmosSelected() + { + // Draw spawn area + Gizmos.color = Color.yellow; + Vector3 center = new Vector3(0f, _screenBottom - spawnDistanceBelowScreen, 0f); + Vector3 size = new Vector3(spawnRangeX * 2f, 1f, 1f); + Gizmos.DrawWireCube(center, size); + + // Draw collision radius at spawn point + Gizmos.color = Color.red; + Gizmos.DrawWireSphere(center, spawnCollisionRadius); + } +#endif + } +} diff --git a/Assets/Scripts/Minigames/DivingForPictures/ObstacleSpawner.cs.meta b/Assets/Scripts/Minigames/DivingForPictures/ObstacleSpawner.cs.meta new file mode 100644 index 00000000..e8591a97 --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/ObstacleSpawner.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 49ec62157fd945fab730193e9ea0bff7 +timeCreated: 1758116903 \ No newline at end of file diff --git a/Assets/Scripts/Minigames/DivingForPictures/PlayerBlinkBehavior.cs b/Assets/Scripts/Minigames/DivingForPictures/PlayerBlinkBehavior.cs new file mode 100644 index 00000000..d30f199f --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/PlayerBlinkBehavior.cs @@ -0,0 +1,242 @@ +using UnityEngine; +using System.Collections; + +namespace Minigames.DivingForPictures +{ + /// + /// Handles visual feedback for player damage by making the sprite renderer blink red. + /// Automatically subscribes to damage events from PlayerCollisionBehavior components. + /// + public class PlayerBlinkBehavior : MonoBehaviour + { + [Header("Blink Settings")] + [Tooltip("Color to blink to when taking damage (typically red for damage indication)")] + [SerializeField] private Color damageBlinkColor = Color.red; + + [Tooltip("How fast to blink between normal and damage colors (seconds between color changes)")] + [SerializeField] private float blinkRate = 0.15f; + + [Tooltip("Alpha value for the damage color (0 = transparent, 1 = opaque)")] + [Range(0f, 1f)] + [SerializeField] private float damageColorAlpha = 0.7f; + + [Header("References")] + [Tooltip("The SpriteRenderer to apply blink effects to (auto-assigned if empty)")] + [SerializeField] private SpriteRenderer targetSpriteRenderer; + + private bool _isBlinking; + private bool _isShowingDamageColor; + private Coroutine _blinkCoroutine; + private Color _originalColor; // Missing field declaration + + private void Awake() + { + // Auto-assign sprite renderer if not set + if (targetSpriteRenderer == null) + { + targetSpriteRenderer = GetComponent(); + if (targetSpriteRenderer == null) + { + targetSpriteRenderer = GetComponentInChildren(); + if (targetSpriteRenderer != null) + { + Debug.Log($"[PlayerBlinkBehavior] Found SpriteRenderer on child object: {targetSpriteRenderer.gameObject.name}"); + } + } + } + + if (targetSpriteRenderer == null) + { + Debug.LogError("[PlayerBlinkBehavior] No SpriteRenderer found on this GameObject or its children!"); + return; + } + + // Store original color + _originalColor = targetSpriteRenderer.color; + + // Ensure damage color has the correct alpha + damageBlinkColor.a = damageColorAlpha; + } + + private void OnEnable() + { + // Subscribe to damage events + PlayerCollisionBehavior.OnDamageStart += StartBlinking; + PlayerCollisionBehavior.OnDamageEnd += StopBlinking; + } + + private void OnDisable() + { + // Unsubscribe from damage events + PlayerCollisionBehavior.OnDamageStart -= StartBlinking; + PlayerCollisionBehavior.OnDamageEnd -= StopBlinking; + + // Stop any ongoing blink effect + if (_blinkCoroutine != null) + { + StopCoroutine(_blinkCoroutine); + _blinkCoroutine = null; + } + + // Restore original color + RestoreOriginalColor(); + } + + /// + /// Starts the red blinking effect when damage begins + /// + private void StartBlinking() + { + if (targetSpriteRenderer == null) return; + + Debug.Log("[PlayerBlinkBehavior] Starting damage blink effect"); + + // Stop any existing blink coroutine + if (_blinkCoroutine != null) + { + StopCoroutine(_blinkCoroutine); + } + + _isBlinking = true; + _isShowingDamageColor = false; + + // Start the blink coroutine + _blinkCoroutine = StartCoroutine(BlinkCoroutine()); + } + + /// + /// Stops the blinking effect when damage ends + /// + private void StopBlinking() + { + Debug.Log("[PlayerBlinkBehavior] Stopping damage blink effect"); + + _isBlinking = false; + + // Stop the blink coroutine + if (_blinkCoroutine != null) + { + StopCoroutine(_blinkCoroutine); + _blinkCoroutine = null; + } + + // Restore original color + RestoreOriginalColor(); + } + + /// + /// Coroutine that handles the blinking animation + /// + private IEnumerator BlinkCoroutine() + { + while (_isBlinking && targetSpriteRenderer != null) + { + // Toggle between original and damage colors + if (_isShowingDamageColor) + { + targetSpriteRenderer.color = _originalColor; + _isShowingDamageColor = false; + } + else + { + targetSpriteRenderer.color = damageBlinkColor; + _isShowingDamageColor = true; + } + + // Wait for blink interval + yield return new WaitForSeconds(blinkRate); + } + } + + /// + /// Restores the sprite renderer to its original color + /// + private void RestoreOriginalColor() + { + if (targetSpriteRenderer != null) + { + targetSpriteRenderer.color = _originalColor; + _isShowingDamageColor = false; + } + } + + /// + /// Updates the original color reference (useful if sprite color changes during gameplay) + /// + public void UpdateOriginalColor() + { + if (targetSpriteRenderer != null && !_isBlinking) + { + _originalColor = targetSpriteRenderer.color; + } + } + + /// + /// Public method to change blink color at runtime + /// + public void SetDamageBlinkColor(Color newColor) + { + damageBlinkColor = newColor; + damageBlinkColor.a = damageColorAlpha; + } + + /// + /// Public method to change blink rate at runtime + /// + public void SetBlinkRate(float rate) + { + blinkRate = rate; + } + + /// + /// Check if currently blinking + /// + public bool IsBlinking => _isBlinking; + + /// + /// Manually trigger blink effect (useful for testing or other damage sources) + /// + public void TriggerBlink(float duration) + { + if (_blinkCoroutine != null) + { + StopCoroutine(_blinkCoroutine); + } + + StartCoroutine(ManualBlinkCoroutine(duration)); + } + + /// + /// Coroutine for manually triggered blink effects + /// + private IEnumerator ManualBlinkCoroutine(float duration) + { + _isBlinking = true; + _isShowingDamageColor = false; + + float elapsed = 0f; + + while (elapsed < duration && targetSpriteRenderer != null) + { + // Toggle between original and damage colors + if (_isShowingDamageColor) + { + targetSpriteRenderer.color = _originalColor; + _isShowingDamageColor = false; + } + else + { + targetSpriteRenderer.color = damageBlinkColor; + _isShowingDamageColor = true; + } + + yield return new WaitForSeconds(blinkRate); + elapsed += blinkRate; + } + + // Ensure we end with original color + RestoreOriginalColor(); + _isBlinking = false; + } + } +} diff --git a/Assets/Scripts/Minigames/DivingForPictures/PlayerBlinkBehavior.cs.meta b/Assets/Scripts/Minigames/DivingForPictures/PlayerBlinkBehavior.cs.meta new file mode 100644 index 00000000..74837a08 --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/PlayerBlinkBehavior.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d8ea29cc80524de8affe17b930cd75c1 +timeCreated: 1758114229 \ No newline at end of file diff --git a/Assets/Scripts/Minigames/DivingForPictures/PlayerBumpCollisionBehavior.cs b/Assets/Scripts/Minigames/DivingForPictures/PlayerBumpCollisionBehavior.cs new file mode 100644 index 00000000..3f928944 --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/PlayerBumpCollisionBehavior.cs @@ -0,0 +1,234 @@ +using UnityEngine; + +namespace Minigames.DivingForPictures +{ + /// + /// Collision behavior that bumps the player toward the center of the trench. + /// Provides two modes: impulse (force-based push) or smooth movement to center. + /// + public class PlayerBumpCollisionBehavior : PlayerCollisionBehavior + { + [Header("Bump Settings")] + [Tooltip("Type of bump response: Impulse pushes with force, SmoothToCenter moves directly to center")] + [SerializeField] private BumpMode bumpMode = BumpMode.Impulse; + + [Tooltip("Force strength for impulse bumps - higher values push further toward center")] + [SerializeField] private float bumpForce = 5.0f; + + [Tooltip("Speed for smooth movement to center (units per second)")] + [SerializeField] private float smoothMoveSpeed = 8.0f; + + [Tooltip("Animation curve controlling bump movement over time")] + [SerializeField] private AnimationCurve bumpCurve = new AnimationCurve(new Keyframe(0f, 0f, 0f, 2f), new Keyframe(1f, 1f, 0f, 0f)); + + [Tooltip("Whether to block player input during bump movement")] + [SerializeField] private bool blockInputDuringBump = true; + + public enum BumpMode + { + Impulse, // Force-based push toward center (distance depends on force) + SmoothToCenter // Smooth movement to center with configurable speed + } + + private bool _isBumping; + private float _bumpTimer; + private float _bumpStartX; + private float _bumpTargetX; + private float _bumpDuration; + private bool _bumpInputBlocked; // Tracks bump-specific input blocking + + protected override void Update() + { + base.Update(); + + // Handle bump movement + if (_isBumping) + { + _bumpTimer -= Time.deltaTime; + + if (_bumpTimer <= 0f) + { + // Bump finished + _isBumping = false; + if (_bumpInputBlocked) + { + RestoreBumpInput(); + } + + // Ensure we end exactly at target + if (playerCharacter != null) + { + Vector3 currentPos = playerCharacter.transform.position; + playerCharacter.transform.position = new Vector3(_bumpTargetX, currentPos.y, currentPos.z); + } + } + else + { + // Apply bump movement + float progress = 1f - (_bumpTimer / _bumpDuration); + float curveValue = bumpCurve.Evaluate(progress); + + float currentX = Mathf.Lerp(_bumpStartX, _bumpTargetX, curveValue); + + // Apply the position to the player character + if (playerCharacter != null) + { + Vector3 currentPos = playerCharacter.transform.position; + playerCharacter.transform.position = new Vector3(currentX, currentPos.y, currentPos.z); + } + } + } + } + + protected override void HandleCollisionResponse(Collider2D obstacle) + { + switch (bumpMode) + { + case BumpMode.Impulse: + StartImpulseBump(); + break; + + case BumpMode.SmoothToCenter: + StartSmoothMoveToCenter(); + break; + } + + Debug.Log($"[PlayerBumpCollisionBehavior] Collision handled with {bumpMode} mode"); + } + + /// + /// Starts an impulse bump toward the center with force-based distance + /// + private void StartImpulseBump() + { + if (playerCharacter == null) return; + + float currentX = playerCharacter.transform.position.x; + + // Calculate bump distance based on force and current position + float directionToCenter = currentX > 0 ? -1f : 1f; // Direction toward center + + // Calculate target position - closer to center based on bump force + float bumpDistance = bumpForce * 0.2f; // Scale factor for distance + float targetX = currentX + (directionToCenter * bumpDistance); + + // Clamp to center if we would overshoot + if ((currentX > 0 && targetX < 0) || (currentX < 0 && targetX > 0)) + { + targetX = 0f; + } + + // Set bump parameters + _bumpStartX = currentX; + _bumpTargetX = targetX; + _bumpDuration = 0.5f; // Fixed duration for impulse + + StartBump(); + + Debug.Log($"[PlayerBumpCollisionBehavior] Starting impulse bump from X={_bumpStartX} to X={_bumpTargetX} (force={bumpForce})"); + } + + /// + /// Starts smooth movement to the center + /// + private void StartSmoothMoveToCenter() + { + if (playerCharacter == null) return; + + float currentX = playerCharacter.transform.position.x; + float distanceToCenter = Mathf.Abs(currentX); + + // Set bump parameters + _bumpStartX = currentX; + _bumpTargetX = 0f; // Always move to center + _bumpDuration = distanceToCenter / smoothMoveSpeed; // Duration based on distance and speed + + StartBump(); + + Debug.Log($"[PlayerBumpCollisionBehavior] Starting smooth move to center from X={_bumpStartX} (speed={smoothMoveSpeed}, duration={_bumpDuration:F2}s)"); + } + + /// + /// Common bump initialization + /// + private void StartBump() + { + _isBumping = true; + _bumpTimer = _bumpDuration; + + // Block player input if enabled (use bump-specific blocking) + if (blockInputDuringBump && playerController != null && playerController.enabled) + { + playerController.enabled = false; + _bumpInputBlocked = true; + Debug.Log("[PlayerBumpCollisionBehavior] Player input blocked during bump"); + } + } + + /// + /// Restores player input after bump movement + /// + private void RestoreBumpInput() + { + if (_bumpInputBlocked && playerController != null) + { + playerController.enabled = true; + _bumpInputBlocked = false; + + // Update the controller's target position to current position to prevent snapping + UpdateControllerTarget(); + + Debug.Log("[PlayerBumpCollisionBehavior] Player input restored after bump"); + } + } + + protected override void OnImmunityEnd() + { + base.OnImmunityEnd(); + + // Stop any ongoing bump if immunity ends + if (_isBumping) + { + _isBumping = false; + if (_bumpInputBlocked) + { + RestoreBumpInput(); + } + } + } + + /// + /// Public method to change bump mode at runtime + /// + public void SetBumpMode(BumpMode mode) + { + bumpMode = mode; + } + + /// + /// Public method to change bump force at runtime + /// + public void SetBumpForce(float force) + { + bumpForce = force; + } + + /// + /// Public method to change smooth move speed at runtime + /// + public void SetSmoothMoveSpeed(float speed) + { + smoothMoveSpeed = speed; + } + + /// + /// Check if player is currently being bumped + /// + public bool IsBumping => _isBumping; + + /// + /// Check if input is currently blocked by bump + /// + public bool IsBumpInputBlocked => _bumpInputBlocked; + } +} diff --git a/Assets/Scripts/Minigames/DivingForPictures/PlayerBumpCollisionBehavior.cs.meta b/Assets/Scripts/Minigames/DivingForPictures/PlayerBumpCollisionBehavior.cs.meta new file mode 100644 index 00000000..78fed5e3 --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/PlayerBumpCollisionBehavior.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8222f0e3aeeb4fc4975aaead6cf7afbe +timeCreated: 1758109619 \ No newline at end of file diff --git a/Assets/Scripts/Minigames/DivingForPictures/PlayerCollisionBehavior.cs b/Assets/Scripts/Minigames/DivingForPictures/PlayerCollisionBehavior.cs new file mode 100644 index 00000000..4916a7e5 --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/PlayerCollisionBehavior.cs @@ -0,0 +1,238 @@ +using UnityEngine; +using System; + +namespace Minigames.DivingForPictures +{ + /// + /// Base class for handling player collisions with world obstacles. + /// Detects collisions between Player layer (7) and WorldObstacle layer (6). + /// + public abstract class PlayerCollisionBehavior : MonoBehaviour + { + [Header("Collision Settings")] + [Tooltip("Duration in seconds of damage immunity after being hit")] + [SerializeField] protected float damageImmunityDuration = 1.0f; + + [Tooltip("Layer mask for obstacle detection - should match WorldObstacle layer")] + [SerializeField] protected LayerMask obstacleLayerMask = 1 << 6; // WorldObstacle layer + + [Header("Input Blocking")] + [Tooltip("Whether to block player input during damage immunity period")] + [SerializeField] protected bool blockInputDuringImmunity; + + [Header("References")] + [Tooltip("The player character GameObject (auto-assigned if empty)")] + [SerializeField] protected GameObject playerCharacter; + + [Tooltip("Reference to the PlayerController component (auto-assigned if empty)")] + [SerializeField] protected PlayerController playerController; + + // Events for damage state changes + public static event Action OnDamageStart; + public static event Action OnDamageEnd; + + /// + /// Public static method to trigger damage start event from external classes + /// + public static void TriggerDamageStart() + { + OnDamageStart?.Invoke(); + } + + /// + /// Public static method to trigger damage end event from external classes + /// + public static void TriggerDamageEnd() + { + OnDamageEnd?.Invoke(); + } + + protected bool isImmune; + protected float immunityTimer; + protected Collider2D playerCollider; + protected bool wasInputBlocked; + + protected virtual void Awake() + { + // Auto-assign if not set in inspector + if (playerCharacter == null) + playerCharacter = gameObject; + + if (playerController == null) + playerController = GetComponent(); + + // Look for collider on this GameObject first, then in children + playerCollider = GetComponent(); + if (playerCollider == null) + { + playerCollider = GetComponentInChildren(); + if (playerCollider != null) + { + Debug.Log($"[{GetType().Name}] Found collider on child object: {playerCollider.gameObject.name}"); + } + } + + if (playerCollider == null) + { + Debug.LogError($"[{GetType().Name}] No Collider2D found on this GameObject or its children!"); + } + } + + protected virtual void Update() + { + // Handle immunity timer + if (isImmune) + { + immunityTimer -= Time.deltaTime; + if (immunityTimer <= 0f) + { + isImmune = false; + OnImmunityEnd(); + } + } + + // Check for collisions if not immune + if (!isImmune && playerCollider != null) + { + CheckForCollisions(); + } + } + + /// + /// Checks for collisions with obstacle layer objects + /// + protected virtual void CheckForCollisions() + { + // Get all colliders overlapping with the player + Collider2D[] overlapping = new Collider2D[10]; + ContactFilter2D filter = new ContactFilter2D(); + filter.SetLayerMask(obstacleLayerMask); + filter.useTriggers = true; + + int count = playerCollider.Overlap(filter, overlapping); + + if (count > 0) + { + // Found collision, trigger response + OnCollisionDetected(overlapping[0]); + } + } + + /// + /// Called when a collision with an obstacle is detected + /// + /// The obstacle collider that was hit + protected virtual void OnCollisionDetected(Collider2D obstacle) + { + if (isImmune) return; + + // Start immunity period + isImmune = true; + immunityTimer = damageImmunityDuration; + + // Call the specific collision response + HandleCollisionResponse(obstacle); + + // Notify about immunity start + OnImmunityStart(); + } + + /// + /// Override this method to implement specific collision response behavior + /// + /// The obstacle that was collided with + protected abstract void HandleCollisionResponse(Collider2D obstacle); + + /// + /// Called when damage immunity starts + /// + protected virtual void OnImmunityStart() + { + Debug.Log($"[{GetType().Name}] Damage immunity started for {damageImmunityDuration} seconds"); + + // Block input if specified + if (blockInputDuringImmunity) + { + BlockPlayerInput(); + } + + // Broadcast damage start event + OnDamageStart?.Invoke(); + } + + /// + /// Called when damage immunity ends + /// + protected virtual void OnImmunityEnd() + { + Debug.Log($"[{GetType().Name}] Damage immunity ended"); + + // Restore input if it was blocked + if (wasInputBlocked) + { + RestorePlayerInput(); + } + + // Broadcast damage end event + OnDamageEnd?.Invoke(); + } + + /// + /// Restores player input after immunity + /// + protected virtual void RestorePlayerInput() + { + if (playerController != null && wasInputBlocked) + { + playerController.enabled = true; + wasInputBlocked = false; + + // Update the controller's target position to current position to prevent snapping + UpdateControllerTarget(); + + Debug.Log($"[{GetType().Name}] Player input restored after immunity"); + } + } + + /// + /// Blocks player input during immunity + /// + protected virtual void BlockPlayerInput() + { + if (playerController != null && playerController.enabled) + { + playerController.enabled = false; + wasInputBlocked = true; + Debug.Log($"[{GetType().Name}] Player input blocked during immunity"); + } + } + + /// + /// Updates the PlayerController's internal target to match current position + /// + protected virtual void UpdateControllerTarget() + { + if (playerController != null && playerCharacter != null) + { + // Use reflection to update the private _targetFingerX field + var targetField = typeof(PlayerController) + .GetField("_targetFingerX", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); + + if (targetField != null) + { + targetField.SetValue(playerController, playerCharacter.transform.position.x); + } + } + } + + /// + /// Public property to check if player is currently immune + /// + public bool IsImmune => isImmune; + + /// + /// Remaining immunity time + /// + public float RemainingImmunityTime => immunityTimer; + } +} diff --git a/Assets/Scripts/Minigames/DivingForPictures/PlayerCollisionBehavior.cs.meta b/Assets/Scripts/Minigames/DivingForPictures/PlayerCollisionBehavior.cs.meta new file mode 100644 index 00000000..6aaae8b0 --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/PlayerCollisionBehavior.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e6c959bca2e24e72bf22e92439580d79 +timeCreated: 1758109598 \ No newline at end of file diff --git a/Assets/Scripts/Minigames/DivingForPictures/PlayerDamageCollisionBehavior.cs b/Assets/Scripts/Minigames/DivingForPictures/PlayerDamageCollisionBehavior.cs new file mode 100644 index 00000000..0d22e39f --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/PlayerDamageCollisionBehavior.cs @@ -0,0 +1,102 @@ +using UnityEngine; + +namespace Minigames.DivingForPictures +{ + /// + /// Collision behavior that handles damage from mobile obstacles. + /// Unlike bump collisions, this only deals damage without physical response. + /// Detects collisions between Player layer (7) and QuarryObstacle layer (11). + /// + public class PlayerDamageCollisionBehavior : PlayerCollisionBehavior + { + [Header("Damage Settings")] + [Tooltip("Base damage amount dealt by obstacles")] + [SerializeField] private float baseDamage = 1f; + + [Tooltip("Whether to use the obstacle's individual damage value or the base damage")] + [SerializeField] private bool useObstacleDamageValue = true; + + protected override void Awake() + { + base.Awake(); + + // Override the obstacle layer mask to target QuarryObstacle layer (11) + obstacleLayerMask = 1 << 11; // QuarryObstacle layer + } + + protected override void HandleCollisionResponse(Collider2D obstacle) + { + float damageAmount = baseDamage; + + // Try to get damage from the obstacle component if enabled + if (useObstacleDamageValue) + { + FloatingObstacle obstacleComponent = obstacle.GetComponent(); + if (obstacleComponent != null) + { + damageAmount = obstacleComponent.Damage; + } + } + + // Apply damage (this could be extended to integrate with a health system) + ApplyDamage(damageAmount); + + Debug.Log($"[PlayerDamageCollisionBehavior] Player took {damageAmount} damage from obstacle {obstacle.gameObject.name}"); + } + + /// + /// Applies damage to the player + /// Override this method to integrate with your health/damage system + /// + /// Amount of damage to apply + protected virtual void ApplyDamage(float damage) + { + // For now, just log the damage + // In a full implementation, this would reduce player health, trigger UI updates, etc. + Debug.Log($"[PlayerDamageCollisionBehavior] Applied {damage} damage to player"); + + // TODO: Integrate with health system when available + // Example: playerHealth.TakeDamage(damage); + } + + /// + /// Override to prevent input blocking during damage immunity + /// Since obstacles pass through the player, we don't want to block input + /// + protected override void OnImmunityStart() + { + Debug.Log($"[PlayerDamageCollisionBehavior] Damage immunity started for {damageImmunityDuration} seconds"); + + // Don't block input for obstacle damage - let player keep moving + // Only broadcast the damage event + TriggerDamageStart(); + } + + /// + /// Override to handle immunity end without input restoration + /// + protected override void OnImmunityEnd() + { + Debug.Log($"[PlayerDamageCollisionBehavior] Damage immunity ended"); + + // Broadcast damage end event + TriggerDamageEnd(); + } + + /// + /// Public method to set base damage at runtime + /// + public void SetBaseDamage(float damage) + { + baseDamage = damage; + } + + /// + /// Public method to toggle between base damage and obstacle-specific damage + /// + public void SetUseObstacleDamage(bool useObstacleDamage) + { + useObstacleDamageValue = useObstacleDamage; + } + } +} diff --git a/Assets/Scripts/Minigames/DivingForPictures/PlayerDamageCollisionBehavior.cs.meta b/Assets/Scripts/Minigames/DivingForPictures/PlayerDamageCollisionBehavior.cs.meta new file mode 100644 index 00000000..e8d0c5be --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/PlayerDamageCollisionBehavior.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c9c18dbd013d42ae8c221e6205e4d49c +timeCreated: 1758116850 \ No newline at end of file diff --git a/Assets/Scripts/Minigames/DivingForPictures/PlayerPhaseCollisionBehavior.cs b/Assets/Scripts/Minigames/DivingForPictures/PlayerPhaseCollisionBehavior.cs new file mode 100644 index 00000000..678084a5 --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/PlayerPhaseCollisionBehavior.cs @@ -0,0 +1,180 @@ +using UnityEngine; + +namespace Minigames.DivingForPictures +{ + /// + /// Collision behavior that grants temporary immunity and allows the player to phase through obstacles. + /// During immunity, the player can pass through all obstacles without further collision detection. + /// + public class PlayerPhaseCollisionBehavior : PlayerCollisionBehavior + { + [Header("Phase Settings")] + [Tooltip("Whether to disable the player's collider during immunity to allow phasing through obstacles")] + [SerializeField] private bool disableColliderDuringImmunity = true; + + [Tooltip("How fast the player sprite blinks during phase mode (seconds between blinks)")] + [SerializeField] private float visualFeedbackBlinkRate = 0.1f; + + private SpriteRenderer _spriteRenderer; + private bool _originalColliderState; + private bool _isBlinking; + private float _blinkTimer; + private Color _originalColor; + private float _originalAlpha; + + protected override void Awake() + { + base.Awake(); + + // Get sprite renderer from player character + if (playerCharacter != null) + { + _spriteRenderer = playerCharacter.GetComponent(); + } + + if (_spriteRenderer != null) + { + _originalColor = _spriteRenderer.color; + _originalAlpha = _originalColor.a; + } + + if (playerCollider != null) + { + _originalColliderState = playerCollider.enabled; + } + } + + protected override void Update() + { + base.Update(); + + // Handle visual feedback blinking during immunity + if (_isBlinking && _spriteRenderer != null) + { + _blinkTimer -= Time.deltaTime; + + if (_blinkTimer <= 0f) + { + // Toggle visibility + Color currentColor = _spriteRenderer.color; + currentColor.a = currentColor.a > 0.5f ? 0.3f : _originalAlpha; + _spriteRenderer.color = currentColor; + + _blinkTimer = visualFeedbackBlinkRate; + } + } + } + + protected override void CheckForCollisions() + { + // Override to skip collision detection entirely during immunity if collider is disabled + if (isImmune && disableColliderDuringImmunity) + { + return; // Skip collision detection completely + } + + base.CheckForCollisions(); + } + + protected override void HandleCollisionResponse(Collider2D obstacle) + { + Debug.Log("[PlayerPhaseCollisionBehavior] Collision detected - entering phase mode"); + + // No immediate physical response - just start immunity period + // The immunity will be handled by the base class + } + + protected override void OnImmunityStart() + { + base.OnImmunityStart(); + + // Disable collider to allow phasing through obstacles + if (disableColliderDuringImmunity && playerCollider != null) + { + playerCollider.enabled = false; + Debug.Log("[PlayerPhaseCollisionBehavior] Collider disabled - entering phase mode"); + } + + // Start visual feedback + StartVisualFeedback(); + } + + protected override void OnImmunityEnd() + { + base.OnImmunityEnd(); + + // Re-enable collider + if (playerCollider != null) + { + playerCollider.enabled = _originalColliderState; + Debug.Log("[PlayerPhaseCollisionBehavior] Collider re-enabled - exiting phase mode"); + } + + // Stop visual feedback + StopVisualFeedback(); + } + + /// + /// Starts the visual feedback to indicate immunity/phase mode + /// + private void StartVisualFeedback() + { + if (_spriteRenderer != null) + { + _isBlinking = true; + _blinkTimer = 0f; + + // Start with reduced opacity + Color immunityColor = _originalColor; + immunityColor.a = 0.3f; + _spriteRenderer.color = immunityColor; + } + } + + /// + /// Stops the visual feedback and restores original appearance + /// + private void StopVisualFeedback() + { + _isBlinking = false; + + if (_spriteRenderer != null) + { + // Restore original color and alpha + _spriteRenderer.color = _originalColor; + } + } + + /// + /// Public method to toggle collider behavior during immunity + /// + public void SetColliderDisabling(bool disable) + { + disableColliderDuringImmunity = disable; + } + + /// + /// Check if player is currently in phase mode + /// + public bool IsPhasing => isImmune && disableColliderDuringImmunity; + + /// + /// Manually trigger phase mode (useful for testing or special abilities) + /// + public void TriggerPhaseMode(float duration = -1f) + { + if (duration > 0f) + { + isImmune = true; + immunityTimer = duration; + OnImmunityStart(); + } + else + { + isImmune = true; + immunityTimer = damageImmunityDuration; + OnImmunityStart(); + } + } + } +} diff --git a/Assets/Scripts/Minigames/DivingForPictures/PlayerPhaseCollisionBehavior.cs.meta b/Assets/Scripts/Minigames/DivingForPictures/PlayerPhaseCollisionBehavior.cs.meta new file mode 100644 index 00000000..52c2563c --- /dev/null +++ b/Assets/Scripts/Minigames/DivingForPictures/PlayerPhaseCollisionBehavior.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d849a517ce3a41249ae9f37d2722cefa +timeCreated: 1758109641 \ No newline at end of file diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 88875ac6..c63061d0 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -18,7 +18,7 @@ TagManager: - Pulver - WorldBoundary - Interactable - - + - QuarryObstacle - - -