From 8cb4fd5d934ae0f24b47af41cfb84a47c0641051 Mon Sep 17 00:00:00 2001 From: orsolya-st Date: Sat, 6 Jun 2026 15:19:13 +0200 Subject: [PATCH] hole, scene management --- Game/Assets/Prefabs/Hole.prefab | 13 +++++++++++++ Game/Assets/Scripts/SceneController.cs | 14 ++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Game/Assets/Prefabs/Hole.prefab b/Game/Assets/Prefabs/Hole.prefab index 5df302d..af27d5d 100644 --- a/Game/Assets/Prefabs/Hole.prefab +++ b/Game/Assets/Prefabs/Hole.prefab @@ -11,6 +11,7 @@ GameObject: - component: {fileID: 7329357223832181834} - component: {fileID: 1230242963583950091} - component: {fileID: 9204716000211697423} + - component: {fileID: -7265910902094411698} m_Layer: 0 m_Name: Hole m_TagString: Hole @@ -129,3 +130,15 @@ CapsuleCollider2D: m_Offset: {x: 0, y: 0} m_Size: {x: 0.8, y: 0.8} m_Direction: 0 +--- !u!114 &-7265910902094411698 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3028864304894384228} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bbf8ab4673d6bf447aab098a12320431, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::SceneController diff --git a/Game/Assets/Scripts/SceneController.cs b/Game/Assets/Scripts/SceneController.cs index 19a6a0d..c932208 100644 --- a/Game/Assets/Scripts/SceneController.cs +++ b/Game/Assets/Scripts/SceneController.cs @@ -1,16 +1,14 @@ using UnityEngine; +using UnityEngine.SceneManagement; public class SceneController : MonoBehaviour { // Start is called once before the first execution of Update after the MonoBehaviour is created - void Start() - { - - } + public int sceneIndex; - // Update is called once per frame - void Update() + private void OggerEnter2D(Collider2D collision) { - + Debug.Log("Hole"); + SceneManager.LoadScene(sceneIndex, LoadSceneMode.Single); } -} +} \ No newline at end of file