From ffed5f109276ae08028bce80859c80b4eeea0103 Mon Sep 17 00:00:00 2001 From: psy020529 <163077953+psy020529@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:57:14 +0900 Subject: [PATCH] Refactoring 3, 8, 10, 11, 12, 13, 21, 24, 27 completed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 디폴트 씬 수정 있습니다! --- .../Anomaly10/floorTile_abnormal.prefab | 4 +- .../Anomalies/Anomaly11/door_opened.prefab | 4 +- .../Anomalies/Anomaly12/ligh_tilted.prefab | 6 +- .../Anomalies/Anomaly13/eyes.prefab | 6 +- .../Anomaly26/fire/Fire.unitypackage.meta | 7 -- .../Anomaly26/fireEx/fireEx.unitypackage.meta | 7 -- .../Anomalies/Anomaly3/noHeadSitGirl.prefab | 35 +++--- .../Anomaly8/professor_Anomaly8.prefab | 39 +++--- .../AnomalyManager (10).prefab | 8 +- .../AnomalyManager (11).prefab | 6 +- .../AnomalyManager (12).prefab | 6 +- .../AnomalyManager (13).prefab | 8 +- .../AnomalyManager (21).prefab | 6 +- .../AnomalyManager (27).prefab | 5 +- .../AnomalyManager (3).prefab | 10 +- .../AnomalyManager (8).prefab | 5 +- 302/Assets/Scenes/DefaultGameScene.unity | 96 ++++++++++++++- .../Scripts/InteractableLaptopForFace.cs | 2 +- .../Anomaly03Controller.cs | 29 +++++ ...er.cs.meta => Anomaly03Controller.cs.meta} | 0 ...dSitGirl.cs => Anomaly03_noHeadSitGirl.cs} | 109 +++++++++------- ...s.meta => Anomaly03_noHeadSitGirl.cs.meta} | 0 .../Anomaly08Controller.cs | 25 ++++ ...er.cs.meta => Anomaly08Controller.cs.meta} | 0 ...aly8_micsound.cs => Anomaly08_micsound.cs} | 116 +++++++++++------- ...und.cs.meta => Anomaly08_micsound.cs.meta} | 0 .../Anomaly08_normal.cs | 30 +++++ .../Anomaly08_normal.cs.meta | 11 ++ .../Anomaly10Controller.cs | 25 ++++ ...er.cs.meta => Anomaly10Controller.cs.meta} | 0 .../Anomaly10Manager.cs | 25 ---- .../Anomaly10_abnormalTile.cs | 66 ++++++---- .../Anomaly11Controller.cs | 25 ++++ ...er.cs.meta => Anomaly11Controller.cs.meta} | 0 .../Anomaly11Manager.cs | 32 ----- .../Anomaly11_normaldoor.cs | 32 +++++ .../Anomaly11_normaldoor.cs.meta | 11 ++ .../Anomaly11_openeddoor.cs | 88 +++++++++---- .../Anomaly12Controller.cs | 25 ++++ ...er.cs.meta => Anomaly12Controller.cs.meta} | 0 .../Anomaly12Manager.cs | 39 ------ .../Anomaly12_normallight.cs | 32 +++++ .../Anomaly12_normallight.cs.meta | 11 ++ .../Anomaly12_tiltedlight.cs | 54 +++++--- .../Anomaly13Controller.cs | 25 ++++ ...er.cs.meta => Anomaly13Controller.cs.meta} | 0 .../Anomaly13Manager.cs | 35 ------ .../Anomaly13_lookingeye.cs | 72 ++++++----- .../Anomaly13_normaleye.cs | 32 +++++ .../Anomaly13_normaleye.cs.meta | 11 ++ .../Anomaly21Controller.cs | 25 ++++ ...er.cs.meta => Anomaly21Controller.cs.meta} | 0 .../Anomaly21Manager.cs | 34 ----- .../SpecificAnomalyManager/Anomaly21_chase.cs | 42 +++++-- .../Anomaly21_normalprofessor.cs | 32 +++++ .../Anomaly21_normalprofessor.cs.meta | 11 ++ .../Anomaly24Controller.cs | 69 +++++++++++ ...er.cs.meta => Anomaly24Controller.cs.meta} | 0 .../Anomaly24Manager.cs | 37 ------ .../Anomaly24_luciddream.cs | 23 +++- .../Anomaly27Controller.cs | 28 +++++ ...er.cs.meta => Anomaly27Controller.cs.meta} | 0 .../Anomaly27Manager.cs | 22 ---- .../Anomaly27_magnifyingclock.cs | 22 +++- .../SpecificAnomalyManager/Anomaly3Manager.cs | 23 ---- .../SpecificAnomalyManager/Anomaly8Manager.cs | 30 ----- 66 files changed, 1053 insertions(+), 565 deletions(-) delete mode 100644 302/Assets/Course Library/Anomalies/Anomaly26/fire/Fire.unitypackage.meta delete mode 100644 302/Assets/Course Library/Anomalies/Anomaly26/fireEx/fireEx.unitypackage.meta create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly03Controller.cs rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly3Manager.cs.meta => Anomaly03Controller.cs.meta} (100%) rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly3_noHeadSitGirl.cs => Anomaly03_noHeadSitGirl.cs} (52%) rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly3_noHeadSitGirl.cs.meta => Anomaly03_noHeadSitGirl.cs.meta} (100%) create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly08Controller.cs rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly8Manager.cs.meta => Anomaly08Controller.cs.meta} (100%) rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly8_micsound.cs => Anomaly08_micsound.cs} (50%) rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly8_micsound.cs.meta => Anomaly08_micsound.cs.meta} (100%) create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_normal.cs create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_normal.cs.meta create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Controller.cs rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly10Manager.cs.meta => Anomaly10Controller.cs.meta} (100%) delete mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Manager.cs create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Controller.cs rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly11Manager.cs.meta => Anomaly11Controller.cs.meta} (100%) delete mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Manager.cs create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_normaldoor.cs create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_normaldoor.cs.meta create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Controller.cs rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly12Manager.cs.meta => Anomaly12Controller.cs.meta} (100%) delete mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Manager.cs create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_normallight.cs create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_normallight.cs.meta create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Controller.cs rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly13Manager.cs.meta => Anomaly13Controller.cs.meta} (100%) delete mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Manager.cs create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_normaleye.cs create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_normaleye.cs.meta create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Controller.cs rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly21Manager.cs.meta => Anomaly21Controller.cs.meta} (100%) delete mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Manager.cs create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_normalprofessor.cs create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_normalprofessor.cs.meta create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Controller.cs rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly24Manager.cs.meta => Anomaly24Controller.cs.meta} (100%) delete mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Manager.cs create mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Controller.cs rename 302/Assets/Scripts/SpecificAnomalyManager/{Anomaly27Manager.cs.meta => Anomaly27Controller.cs.meta} (100%) delete mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Manager.cs delete mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly3Manager.cs delete mode 100644 302/Assets/Scripts/SpecificAnomalyManager/Anomaly8Manager.cs diff --git a/302/Assets/Course Library/Anomalies/Anomaly10/floorTile_abnormal.prefab b/302/Assets/Course Library/Anomalies/Anomaly10/floorTile_abnormal.prefab index 3fa159c..3cbd79d 100644 --- a/302/Assets/Course Library/Anomalies/Anomaly10/floorTile_abnormal.prefab +++ b/302/Assets/Course Library/Anomalies/Anomaly10/floorTile_abnormal.prefab @@ -271,8 +271,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 20681d21fd96f1d4997f4ec4d7641215, type: 3} m_Name: m_EditorClassIdentifier: - promptMessage: "\uD074\uB9AD\uD558\uC5EC \uC0C1\uD638\uC791\uC6A9" - interactionRange: 2 + prompt: + distanceInteractionMax: 5 --- !u!82 &-3146942907749045525 AudioSource: m_ObjectHideFlags: 0 diff --git a/302/Assets/Course Library/Anomalies/Anomaly11/door_opened.prefab b/302/Assets/Course Library/Anomalies/Anomaly11/door_opened.prefab index 01e43bc..059f1c0 100644 --- a/302/Assets/Course Library/Anomalies/Anomaly11/door_opened.prefab +++ b/302/Assets/Course Library/Anomalies/Anomaly11/door_opened.prefab @@ -160,8 +160,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0308f3d0e5f4a2b468bacc485aebf6d2, type: 3} m_Name: m_EditorClassIdentifier: - promptMessage: "\uD074\uB9AD\uD558\uC5EC \uC0C1\uD638\uC791\uC6A9" - interactionRange: 2 + prompt: + distanceInteractionMax: 2 fadeImage: {fileID: 6108600949248145028, guid: af86313d08cec4241a8b1edd8d8a29da, type: 3} fadeSpeed: 2 closeSpeed: 1 diff --git a/302/Assets/Course Library/Anomalies/Anomaly12/ligh_tilted.prefab b/302/Assets/Course Library/Anomalies/Anomaly12/ligh_tilted.prefab index 9758c60..0cae19f 100644 --- a/302/Assets/Course Library/Anomalies/Anomaly12/ligh_tilted.prefab +++ b/302/Assets/Course Library/Anomalies/Anomaly12/ligh_tilted.prefab @@ -192,7 +192,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 7578491145889696626} m_LocalRotation: {x: 0, y: 0.06975647, z: 0, w: 0.9975641} - m_LocalPosition: {x: -13.900001, y: 0, z: 0.5} + m_LocalPosition: {x: 1.7000008, y: 8, z: 1} m_LocalScale: {x: 1, y: 1, z: 2.7} m_ConstrainProportionsScale: 0 m_Children: @@ -226,6 +226,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8f01f1db524329643a33a6f26ae020eb, type: 3} m_Name: m_EditorClassIdentifier: - promptMessage: "\uD074\uB9AD\uD558\uC5EC \uC0C1\uD638\uC791\uC6A9" - interactionRange: 2 + prompt: + distanceInteractionMax: 4 rotationSpeed: 1 diff --git a/302/Assets/Course Library/Anomalies/Anomaly13/eyes.prefab b/302/Assets/Course Library/Anomalies/Anomaly13/eyes.prefab index b0d66ab..cabd5b2 100644 --- a/302/Assets/Course Library/Anomalies/Anomaly13/eyes.prefab +++ b/302/Assets/Course Library/Anomalies/Anomaly13/eyes.prefab @@ -60,10 +60,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 93b91f91247fb0b45aeedc1f250a1e63, type: 3} m_Name: m_EditorClassIdentifier: - player: {fileID: 0} - leftEye: {fileID: 0} - rightEye: {fileID: 0} - rotationOffsetX: -90 + prompt: + distanceInteractionMax: 5 --- !u!1001 &4036253353244585447 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/302/Assets/Course Library/Anomalies/Anomaly26/fire/Fire.unitypackage.meta b/302/Assets/Course Library/Anomalies/Anomaly26/fire/Fire.unitypackage.meta deleted file mode 100644 index a819dbb..0000000 --- a/302/Assets/Course Library/Anomalies/Anomaly26/fire/Fire.unitypackage.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 9e44e6e8c6b4444818d678344091a86d -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/302/Assets/Course Library/Anomalies/Anomaly26/fireEx/fireEx.unitypackage.meta b/302/Assets/Course Library/Anomalies/Anomaly26/fireEx/fireEx.unitypackage.meta deleted file mode 100644 index ac7fa65..0000000 --- a/302/Assets/Course Library/Anomalies/Anomaly26/fireEx/fireEx.unitypackage.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 905a3c281cc5d471d99e87d04d99c4c0 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/302/Assets/Course Library/Anomalies/Anomaly3/noHeadSitGirl.prefab b/302/Assets/Course Library/Anomalies/Anomaly3/noHeadSitGirl.prefab index e3c8108..12a2bdd 100644 --- a/302/Assets/Course Library/Anomalies/Anomaly3/noHeadSitGirl.prefab +++ b/302/Assets/Course Library/Anomalies/Anomaly3/noHeadSitGirl.prefab @@ -1829,8 +1829,8 @@ GameObject: - component: {fileID: 5702866697557762460} - component: {fileID: -5115927794089966355} - component: {fileID: 1762372057293109387} - - component: {fileID: 102974955409158419} - component: {fileID: 2823924222544873001} + - component: {fileID: 5847809326673953691} m_Layer: 3 m_Name: noHeadSitGirl m_TagString: Untagged @@ -1845,8 +1845,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4931291677343464230} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} + m_LocalPosition: {x: -1.72, y: -0.92, z: -6.15} m_LocalScale: {x: 2, y: 2, z: 2} m_ConstrainProportionsScale: 0 m_Children: @@ -1924,21 +1924,6 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 0.78868043, y: 1.2432933, z: 0.8379879} m_Center: {x: -0.007043898, y: 1.0091901, z: 0.081006035} ---- !u!114 &102974955409158419 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4931291677343464230} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d9b3f08a1c74cca4da83f16b57568fbf, type: 3} - m_Name: - m_EditorClassIdentifier: - promptMessage: "\uD074\uB9AD\uD558\uC5EC \uC0C1\uD638\uC791\uC6A9" - interactionRange: 2 - interactionSoundPrefab: {fileID: 0} --- !u!82 &2823924222544873001 AudioSource: m_ObjectHideFlags: 0 @@ -2035,6 +2020,20 @@ AudioSource: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 +--- !u!114 &5847809326673953691 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4931291677343464230} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d9b3f08a1c74cca4da83f16b57568fbf, type: 3} + m_Name: + m_EditorClassIdentifier: + prompt: + distanceInteractionMax: 2 --- !u!1 &5032775393752142314 GameObject: m_ObjectHideFlags: 0 diff --git a/302/Assets/Course Library/Anomalies/Anomaly8/professor_Anomaly8.prefab b/302/Assets/Course Library/Anomalies/Anomaly8/professor_Anomaly8.prefab index acea430..4d2043a 100644 --- a/302/Assets/Course Library/Anomalies/Anomaly8/professor_Anomaly8.prefab +++ b/302/Assets/Course Library/Anomalies/Anomaly8/professor_Anomaly8.prefab @@ -3082,8 +3082,8 @@ GameObject: - component: {fileID: 8773584364483337333} - component: {fileID: -7422413402872412774} - component: {fileID: -1963283817825714181} - - component: {fileID: 8480570695569470048} - component: {fileID: 3429054842545089841} + - component: {fileID: 5851915364222104651} m_Layer: 3 m_Name: professor_Anomaly8 m_TagString: Untagged @@ -3098,8 +3098,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 8253366189145917135} - m_LocalRotation: {x: 0, y: 0.7071068, z: -0, w: -0.7071068} - m_LocalPosition: {x: -0.9374157, y: 1.4354091, z: 2.6702428} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: -0.7071068} + m_LocalPosition: {x: 14, y: 0, z: 0.8} m_LocalScale: {x: 2, y: 2, z: 2} m_ConstrainProportionsScale: 0 m_Children: @@ -3178,21 +3178,6 @@ CapsuleCollider: m_Height: 2.0122426 m_Direction: 1 m_Center: {x: -0.0046090484, y: 0.9393765, z: 0.12905467} ---- !u!114 &8480570695569470048 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8253366189145917135} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 13668f2615e0a94489f12ccbeb6d1c48, type: 3} - m_Name: - m_EditorClassIdentifier: - promptMessage: "\uD074\uB9AD\uD558\uC5EC \uC0C1\uD638\uC791\uC6A9" - interactionRange: 2 - maxVolumeDistance: 5 --- !u!82 &3429054842545089841 AudioSource: m_ObjectHideFlags: 0 @@ -3289,6 +3274,24 @@ AudioSource: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 +--- !u!114 &5851915364222104651 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8253366189145917135} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 13668f2615e0a94489f12ccbeb6d1c48, type: 3} + m_Name: + m_EditorClassIdentifier: + prompt: + distanceInteractionMax: 2 + maxVolumeDistance: 5 + startDistance: 30 + fadeOutDuration: 2 + audioStartDelay: 5 --- !u!1 &8279582076143391115 GameObject: m_ObjectHideFlags: 0 diff --git a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (10).prefab b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (10).prefab index cd55de9..776c300 100644 --- a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (10).prefab +++ b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (10).prefab @@ -9,7 +9,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 242199192578515326} - - component: {fileID: 242199192578515327} + - component: {fileID: -4456860463678520930} m_Layer: 0 m_Name: AnomalyManager (10) m_TagString: Untagged @@ -32,7 +32,7 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &242199192578515327 +--- !u!114 &-4456860463678520930 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -44,4 +44,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8ee0d51b9421e4225a3063944179fe0d, type: 3} m_Name: m_EditorClassIdentifier: - abnormalTilePrefab: {fileID: 9055656618054629428, guid: bb9039250362fbd4fa80976616652088, type: 3} + names: [] + prefabs: + - {fileID: 9055656618054629428, guid: bb9039250362fbd4fa80976616652088, type: 3} diff --git a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (11).prefab b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (11).prefab index 11aa8a1..aafde74 100644 --- a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (11).prefab +++ b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (11).prefab @@ -44,5 +44,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 60b202be270b34142adf24b6c800fda5, type: 3} m_Name: m_EditorClassIdentifier: - targetDoorName: door - doorOpenedPrefab: {fileID: 8121868656660789279, guid: c893de987f87ca142b73f034e6b12896, type: 3} + names: + - Classroom/WallRight/door + prefabs: + - {fileID: 8121868656660789279, guid: c893de987f87ca142b73f034e6b12896, type: 3} diff --git a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (12).prefab b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (12).prefab index 0f3a1c9..b72256b 100644 --- a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (12).prefab +++ b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (12).prefab @@ -44,5 +44,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4ea9c09112d4b4ec080ddd838dbd3f86, type: 3} m_Name: m_EditorClassIdentifier: - targetLightName: light (4) - tiltedLightPrefab: {fileID: 7578491145889696626, guid: a25ddb5ae5b6b1849b3b874a6401e9ea, type: 3} + names: + - Classroom/ceiling/Lights/light (4) + prefabs: + - {fileID: 7578491145889696626, guid: a25ddb5ae5b6b1849b3b874a6401e9ea, type: 3} diff --git a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (13).prefab b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (13).prefab index 889d3e6..8ee6a6f 100644 --- a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (13).prefab +++ b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (13).prefab @@ -44,6 +44,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b863f6020c9be4d36af5976ae7def815, type: 3} m_Name: m_EditorClassIdentifier: - targetObjectName: sitGirl - lookingGirlPrefab: {fileID: 865672691596713360, guid: 3ea9e4e205f1eb2418fc327cd3c3f601, type: 3} - eyesPrefab: {fileID: 3430613836902118324, guid: 11e3551dd4b590742b42d0da43be8523, type: 3} + names: + - SitGirls/sitGirl/_eye_left + - SitGirls/sitGirl/eye_right + prefabs: + - {fileID: 3430613836902118324, guid: 11e3551dd4b590742b42d0da43be8523, type: 3} diff --git a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (21).prefab b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (21).prefab index 517bcff..22bb93b 100644 --- a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (21).prefab +++ b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (21).prefab @@ -44,5 +44,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7089c0d6190134ca985c8ad224f6c04e, type: 3} m_Name: m_EditorClassIdentifier: - targetObjectName: professor_normal - professorPrefab: {fileID: 7831368780425544879, guid: a655570cc35bfc949a9c58b5eb8b4a90, type: 3} + names: + - professor_normal + prefabs: + - {fileID: 7831368780425544879, guid: a655570cc35bfc949a9c58b5eb8b4a90, type: 3} diff --git a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (27).prefab b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (27).prefab index 44da8f3..1279273 100644 --- a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (27).prefab +++ b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (27).prefab @@ -44,5 +44,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: bf3259c18316d40cc8480a306dee7396, type: 3} m_Name: m_EditorClassIdentifier: - targetObjectName: clock - clockPrefab: {fileID: 791923717464669601, guid: 64c3e9afb26debe44847a16a22c4dae8, type: 3} + names: [] + prefabs: + - {fileID: 791923717464669601, guid: 64c3e9afb26debe44847a16a22c4dae8, type: 3} diff --git a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (3).prefab b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (3).prefab index ad3b70b..835c3e7 100644 --- a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (3).prefab +++ b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (3).prefab @@ -9,7 +9,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 8155634044022115139} - - component: {fileID: 8155634044022115138} + - component: {fileID: 6771753627572306098} m_Layer: 0 m_Name: AnomalyManager (3) m_TagString: Untagged @@ -32,7 +32,7 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} ---- !u!114 &8155634044022115138 +--- !u!114 &6771753627572306098 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -44,6 +44,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fcbd18baab98f449ca317b70a293321b, type: 3} m_Name: m_EditorClassIdentifier: - headlessSchoolgirlPrefab: {fileID: 4931291677343464230, guid: 30233d2ccbd511e4fab58553448c1bd4, type: 3} - spawnLocation: {fileID: 0} - chairPrefab: {fileID: 0} + names: [] + prefabs: + - {fileID: 4931291677343464230, guid: 30233d2ccbd511e4fab58553448c1bd4, type: 3} diff --git a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (8).prefab b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (8).prefab index a9f30a8..0687abf 100644 --- a/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (8).prefab +++ b/302/Assets/Prefabs/AnomalyControllers/AnomalyManager (8).prefab @@ -44,5 +44,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7327451d79d164181b37686d02ca311a, type: 3} m_Name: m_EditorClassIdentifier: - normalProfessorPrefab: {fileID: 8253366189145917135, guid: 4dbfb06eecc5e57499f6ea0d7a944a7d, type: 3} + names: + - professor_normal + prefabs: + - {fileID: 8253366189145917135, guid: 75a39b1d903b8ea44b089727e4979d46, type: 3} micSoundProfessorPrefab: {fileID: 8253366189145917135, guid: 75a39b1d903b8ea44b089727e4979d46, type: 3} diff --git a/302/Assets/Scenes/DefaultGameScene.unity b/302/Assets/Scenes/DefaultGameScene.unity index 109d3a1..090adfc 100644 --- a/302/Assets/Scenes/DefaultGameScene.unity +++ b/302/Assets/Scenes/DefaultGameScene.unity @@ -1261,6 +1261,23 @@ MonoBehaviour: defaultXMax: 960 defaultYMin: 0 defaultYMax: 540 +--- !u!1 &80334030 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 589333374628169546, guid: 9e5b64cc1f2ea46498fc5952bf0d5895, type: 3} + m_PrefabInstance: {fileID: 1162939157} + m_PrefabAsset: {fileID: 0} +--- !u!114 &80334034 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 80334030} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9a55ff71c373727419603887e590ca1a, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &82428849 PrefabInstance: m_ObjectHideFlags: 0 @@ -10136,6 +10153,11 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 16 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &470489866 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: a761dc7f86aa54dbfadca3ebd82de9b9, type: 3} + m_PrefabInstance: {fileID: 1323675347} + m_PrefabAsset: {fileID: 0} --- !u!1 &473065234 GameObject: m_ObjectHideFlags: 0 @@ -11219,6 +11241,35 @@ GameObject: m_CorrespondingSourceObject: {fileID: 5959471144119029934, guid: b49efed64fd3d8d439cfd1de3a9808f5, type: 3} m_PrefabInstance: {fileID: 1983020637} m_PrefabAsset: {fileID: 0} +--- !u!1 &550563608 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8253366189145917135, guid: 4dbfb06eecc5e57499f6ea0d7a944a7d, type: 3} + m_PrefabInstance: {fileID: 1487742019} + m_PrefabAsset: {fileID: 0} +--- !u!114 &550563612 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 550563608} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c74fcacda5ca304409e13b81453d92a2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &550563613 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 550563608} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6aa0d459c4e2b834fad9092d089c5c87, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &552901641 PrefabInstance: m_ObjectHideFlags: 0 @@ -29599,6 +29650,18 @@ Transform: m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: a761dc7f86aa54dbfadca3ebd82de9b9, type: 3} m_PrefabInstance: {fileID: 1323675347} m_PrefabAsset: {fileID: 0} +--- !u!114 &1323675349 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 470489866} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4105322dccdeddd4e9b964be20fc04d5, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &1326316623 PrefabInstance: m_ObjectHideFlags: 0 @@ -32903,6 +32966,18 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 1.438041, y: 2.279755, z: 2.0562773} m_Center: {x: -0.21902043, y: 0.2507244, z: -0.038850203} +--- !u!114 &1481598554 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1042280326} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 48c9e4b5058bb344389c1cfed59a4c2e, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &1482182348 PrefabInstance: m_ObjectHideFlags: 0 @@ -35065,6 +35140,23 @@ Transform: m_CorrespondingSourceObject: {fileID: 7236329420339151181, guid: 2ad42fc20dee64e4ca84470ffa3fb42e, type: 3} m_PrefabInstance: {fileID: 1635467067} m_PrefabAsset: {fileID: 0} +--- !u!1 &1636694565 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 5499406867248628635, guid: 9e5b64cc1f2ea46498fc5952bf0d5895, type: 3} + m_PrefabInstance: {fileID: 1162939157} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1636694569 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1636694565} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9a55ff71c373727419603887e590ca1a, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &1638073350 PrefabInstance: m_ObjectHideFlags: 0 @@ -43162,9 +43254,9 @@ MonoBehaviour: - {fileID: 5650449145146738954, guid: 11a50fb479ce40a4698c9b8f9816f567, type: 3} - {fileID: 3233071982878084982, guid: 5156428cd2b781d4dabf6a30befa7685, type: 3} - {fileID: 5605359256125054964, guid: 48c8f10abe45bef4098efae902701f34, type: 3} - checkSpecificAnomaly: 0 + checkSpecificAnomaly: 1 checkIntersect: 0 - SpecificAnomalyNum: 11 + SpecificAnomalyNum: 21 currentAnomalyInstance: {fileID: 8678062959089499939, guid: 6aadfcd777444a24180cf51012c6e89c, type: 3} --- !u!4 &1964216256 Transform: diff --git a/302/Assets/Scripts/InteractableLaptopForFace.cs b/302/Assets/Scripts/InteractableLaptopForFace.cs index d7be159..21af9b5 100644 --- a/302/Assets/Scripts/InteractableLaptopForFace.cs +++ b/302/Assets/Scripts/InteractableLaptopForFace.cs @@ -6,7 +6,7 @@ public class InteractableLaptopForFace : InteractableLaptop public override void OnInteract() { - Anomaly02_Laptop obj = GetComponentInParent(); + Anomaly02Laptop obj = GetComponentInParent(); base.OnInteract(); diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly03Controller.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly03Controller.cs new file mode 100644 index 0000000..f873934 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly03Controller.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +public class Anomaly03Controller : AbstractAnomalyComposite +{ + // 클래스 이름 + public override string Name { get; } = "Anomaly03Controller"; + + /************************************* + * implementation: AbstractBehaviour * + *************************************/ + + // `Awake` 메시지 용 메서드 + protected override bool Awake_() + { + bool res = base.Awake_(); + + // Code used before `GameManager` updates begin + Log("Call `StartAnomaly` begin"); + if (StartAnomaly()) { + Log("Call `StartAnomaly` success"); + } else { + Log("Call `StartAnomaly` failed", mode: 1); + res = false; + } + // Code used before `GameManager` updates end + + return res; + } +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly3Manager.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly03Controller.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly3Manager.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly03Controller.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly3_noHeadSitGirl.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly03_noHeadSitGirl.cs similarity index 52% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly3_noHeadSitGirl.cs rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly03_noHeadSitGirl.cs index ade9b71..08a3d49 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly3_noHeadSitGirl.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly03_noHeadSitGirl.cs @@ -1,16 +1,64 @@ using UnityEngine; using System.Collections; +[RequireComponent(typeof(AudioSource))] -public class Anomaly3_noHeadSitGirl : InteractableObject, IInteractable +public class Anomaly03_noHeadSitGirl : AbstractAnomalyInteractable { - private bool hasInteracted = false; // Ensures only one interaction occurs + // 클래스 이름 + public override string Name { get; } = "Anomaly03_noHeadSitGirl"; private Transform cameraTransform; // Reference to the Main Camera's transform private AudioSource audioSource; // Reference to the AudioSource component + private float distanceToCamera; // Distance between player and anomaly object - private void Start() + // 상호작용 시 실행될 메서드 + public virtual void OnInteract() + { + base.OnInteract(); + + Log("Call `GameManager.SetStageClear` begin"); + GameManager.Instance.SetStageClear(); + Log("Call `GameManager.SetStageClear` end"); + + // Code used before `GameManager` updates begin + GameObject controllerObject = GameObject.Find("AnomalyManager (3)(Clone)"); + AbstractAnomalyObject controller = controllerObject.GetComponent(); + + Log($"Call `{controller.Name}.ResetAnomaly` begin"); + if (controller.ResetAnomaly()) { + Log($"Call `{controller.Name}.ResetAnomaly` success"); + } else { + Log($"Call `{controller.Name}.ResetAnomaly` failed", mode: 1); + } + // Code used before `GameManager` updates end + } + + // 현재 상호작용 가능한지 여부 반환 + public virtual bool CanInteract(float distance) + { + bool res = base.CanInteract(distance); + + return res; + } + + // 필드를 초기화하는 메서드 + protected override bool InitFields() + { + bool res = base.InitFields(); + + // Get the AudioSource component + audioSource = GetComponent(); + if (audioSource == null) + { + Debug.LogError("AudioSource component is missing on the prefab."); + res = false; + } + + return res; + } + + private void Update() { - // Find the main camera in the scene GameObject mainCamera = GameObject.FindWithTag("MainCamera"); if (mainCamera != null) { @@ -20,21 +68,25 @@ private void Start() { Debug.LogError("Main Camera not found! Ensure the main camera has the 'MainCamera' tag."); } + + distanceToCamera = Vector3.Distance(transform.position, cameraTransform.position); - // Get the AudioSource component - audioSource = GetComponent(); - if (audioSource == null) - { - Debug.LogError("AudioSource component is missing on the prefab."); - } + CheckAndPlayAudio(); + } - private void Update() + // 이상현상을 초기화하는 메서드 + public override bool ResetAnomaly() { - if (cameraTransform == null || audioSource == null) return; + bool res = base.ResetAnomaly(); + + StartCoroutine(FadeOut(gameObject, 2f)); // Fades out over 2 seconds + + return res; + } - // Check the distance to the camera and play sound if within 5f - float distanceToCamera = Vector3.Distance(transform.position, cameraTransform.position); + private void CheckAndPlayAudio() + { if (distanceToCamera <= 5f) { if (!audioSource.isPlaying) // Start playing if not already playing @@ -51,31 +103,7 @@ private void Update() } } - // Returns the prompt text for interaction (e.g., displayed on cursor) - public string GetInteractionPrompt() - { - return "Press Left Click to interact with the figure"; - } - - // Determines if interaction is currently possible - public bool CanInteract(float distance) - { - return !hasInteracted; // Interaction is allowed only once - } - // modified by 신채환 - // CanInteract 메서드가 거리를 인자로 받도록 변경 - - // Handles interaction with the headless schoolgirl - public void OnInteract() - { - if (hasInteracted) return; // Ensure interaction only happens once - - hasInteracted = true; - StartCoroutine(FadeOutAndClearStage(gameObject, 2f)); // Fades out over 2 seconds and then clears stage - } - - // Coroutine to gradually fade out, destroy the object, and set the stage clear - private IEnumerator FadeOutAndClearStage(GameObject obj, float duration) + private IEnumerator FadeOut(GameObject obj, float duration) { Renderer[] renderers = obj.GetComponentsInChildren(); float elapsedTime = 0f; @@ -101,8 +129,5 @@ private IEnumerator FadeOutAndClearStage(GameObject obj, float duration) } Destroy(obj); // Remove the object completely after fading out - - // Mark the stage as clear after the object is fully faded out - GameManager.Instance.SetStageClear(); } } diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly3_noHeadSitGirl.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly03_noHeadSitGirl.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly3_noHeadSitGirl.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly03_noHeadSitGirl.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08Controller.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08Controller.cs new file mode 100644 index 0000000..7fb4dca --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08Controller.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +public class Anomaly08Controller : AbstractAnomalyComposite +{ + // 클래스 이름 + public override string Name { get; } = "Anomaly08Controller"; + + // `Awake` 메시지 용 메서드 + protected override bool Awake_() + { + bool res = base.Awake_(); + + // Code used before `GameManager` updates begin + Log("Call `StartAnomaly` begin"); + if (StartAnomaly()) { + Log("Call `StartAnomaly` success"); + } else { + Log("Call `StartAnomaly` failed", mode: 1); + res = false; + } + // Code used before `GameManager` updates end + + return res; + } +} \ No newline at end of file diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly8Manager.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08Controller.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly8Manager.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly08Controller.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly8_micsound.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_micsound.cs similarity index 50% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly8_micsound.cs rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_micsound.cs index ac350d3..9d7cb68 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly8_micsound.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_micsound.cs @@ -1,11 +1,11 @@ using UnityEngine; using System.Collections; -public class Anomaly8_micsound : InteractableObject, IInteractable +public class Anomaly08_micsound : AbstractAnomalyInteractable { - private bool hasInteracted = false; // Ensures only one interaction occurs - private Transform playerTransform; // Reference to the player's transform - private AudioSource audioSource; // Reference to the AudioSource component + + private Transform playerTransform; + private AudioSource audioSource; public float maxVolumeDistance = 5f; // Distance at which the audio reaches max volume public float startDistance = 30f; // Maximum distance where the audio starts being audible @@ -14,9 +14,37 @@ public class Anomaly8_micsound : InteractableObject, IInteractable private bool isAudioActive = false; - private void Start() + // 클래스 이름 + public override string Name { get; } = "Anomaly08_micsound"; + + // 상호작용 시 실행될 메서드 + public override void OnInteract() + { + base.OnInteract(); + + Log("Call `GameManager.SetStageClear` begin"); + GameManager.Instance.SetStageClear(); + Log("Call `GameManager.SetStageClear` end"); + + // Code used before `GameManager` updates begin + GameObject controllerObject = GameObject.Find("AnomalyManager (8)(Clone)"); + AbstractAnomalyObject controller = controllerObject.GetComponent(); + + Log($"Call `{controller.Name}.ResetAnomaly` begin"); + if (controller.ResetAnomaly()) { + Log($"Call `{controller.Name}.ResetAnomaly` success"); + } else { + Log($"Call `{controller.Name}.ResetAnomaly` failed", mode: 1); + } + // Code used before `GameManager` updates end + + } + + // 필드를 초기화하는 메서드 + protected override bool InitFields() { - // Locate the player (or main camera, as specified) + bool res = base.InitFields(); + GameObject player = GameObject.FindWithTag("MainCamera"); if (player != null) { @@ -25,6 +53,7 @@ private void Start() else { Debug.LogError("Main Camera not found! Make sure the main camera has the 'MainCamera' tag."); + res = false; } // Get the AudioSource component attached to this GameObject @@ -33,72 +62,65 @@ private void Start() { audioSource.loop = true; // Ensure the sound loops continuously until interaction audioSource.volume = 0f; - StartCoroutine(DelayedAudiosStart()); } else { Debug.LogError("AudioSource component is missing on Anomaly8_micsound."); + res = false; } + return res; } - private IEnumerator DelayedAudiosStart() + // 이상현상을 시작하는 메서드 + public override bool StartAnomaly() { - yield return new WaitForSeconds(audioStartDelay); - isAudioActive = true; - audioSource.Play(); - Debug.Log("Audio playback started after delay."); - + bool res = base.StartAnomaly(); + + StartCoroutine(DelayedAudiosStart()); + + return res; } private void Update() { - if (playerTransform == null || audioSource == null) return; + // Calculate the distance between the player and this object + float distanceToPlayer = Vector3.Distance(transform.position, playerTransform.position); - if (!hasInteracted) + // Adjust the volume based on the distance, from 0 at `startDistance` to 1 at `maxVolumeDistance` + if (distanceToPlayer <= startDistance) { - // Calculate the distance between the player and this object - float distanceToPlayer = Vector3.Distance(transform.position, playerTransform.position); - - // Adjust the volume based on the distance, from 0 at `startDistance` to 1 at `maxVolumeDistance` - if (distanceToPlayer <= startDistance) - { - audioSource.volume = Mathf.Clamp01(1 - ((distanceToPlayer - maxVolumeDistance) / (startDistance - maxVolumeDistance))); - } - else - { - audioSource.volume = 0f; // Ensure volume is zero if outside the starting distance - } + audioSource.volume = Mathf.Clamp01(1 - ((distanceToPlayer - maxVolumeDistance) / (startDistance - maxVolumeDistance))); + } + else + { + audioSource.volume = 0f; // Ensure volume is zero if outside the starting distance } } - // Returns the prompt text for interaction - public string GetInteractionPrompt() + // 이상현상을 초기화하는 메서드 + public override bool ResetAnomaly() { - return "Press Left Click to interact with the microphone sound"; - } + bool res = base.ResetAnomaly(); - // Determines if interaction is currently possible - public bool CanInteract(float distance) - { - return !hasInteracted; // Allow interaction only once + StartCoroutine(FadeOutAndStop()); // Start fade-out coroutine upon interaction + + + return res; } - // modified by 신채환 - // CanInteract 메서드가 거리를 인자로 받도록 변경 - // Handles interaction with the microphone - public void OnInteract() + private IEnumerator DelayedAudiosStart() { - if (hasInteracted) return; // Ensure interaction only happens once - - hasInteracted = true; - StartCoroutine(FadeOutAndStop()); // Start fade-out coroutine upon interaction - Debug.Log("Microphone sound interaction triggered: Sound fading out."); - GameManager.Instance.SetStageClear(); + yield return new WaitForSeconds(audioStartDelay); + isAudioActive = true; + audioSource.Play(); + Debug.Log("Audio playback started after delay."); + } // Coroutine to gradually fade out the volume and stop the audio private IEnumerator FadeOutAndStop() { + Debug.Log("Microphone sound interaction triggered: Sound fading out."); float startVolume = audioSource.volume; float elapsed = 0f; @@ -110,6 +132,6 @@ private IEnumerator FadeOutAndStop() } audioSource.Stop(); // Stop the audio playback completely - audioSource.volume = startVolume; // Reset volume for potential reuse of this script + //audioSource.volume = startVolume; // Reset volume for potential reuse of this script } -} +} \ No newline at end of file diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly8_micsound.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_micsound.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly8_micsound.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_micsound.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_normal.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_normal.cs new file mode 100644 index 0000000..a7d9ec8 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_normal.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +public class Anomaly08_normal : AbstractAnomalyObject +{ + /********** + * fields * + **********/ + + /************** + * properties * + **************/ + + // 클래스 이름 + public override string Name { get; } = "Anomaly08_normal"; + + /***************************************** + * implementation: AbstractAnomalyObject * + *****************************************/ + + // 이상현상을 시작하는 메서드 + public override bool StartAnomaly() + { + bool res = base.StartAnomaly(); + + gameObject.SetActive(false); + Log("Deleted normal professor."); + + return res; + } +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_normal.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_normal.cs.meta new file mode 100644 index 0000000..92d1154 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly08_normal.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c74fcacda5ca304409e13b81453d92a2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Controller.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Controller.cs new file mode 100644 index 0000000..bba5e7e --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Controller.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +public class Anomaly10Controller : AbstractAnomalyComposite +{ + // 클래스 이름 + public override string Name { get; } = "Anomaly10Controller"; // TODO: 클래스 이름 추가하기. + + // `Awake` 메시지 용 메서드 + protected override bool Awake_() + { + bool res = base.Awake_(); + + // Code used before `GameManager` updates begin + Log("Call `StartAnomaly` begin"); + if (StartAnomaly()) { + Log("Call `StartAnomaly` success"); + } else { + Log("Call `StartAnomaly` failed", mode: 1); + res = false; + } + // Code used before `GameManager` updates end + + return res; + } +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Manager.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Controller.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Manager.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Controller.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Manager.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Manager.cs deleted file mode 100644 index 28d17ca..0000000 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10Manager.cs +++ /dev/null @@ -1,25 +0,0 @@ -using UnityEngine; - -public class Anomaly10Manager : MonoBehaviour -{ - public GameObject abnormalTilePrefab; // Prefab for the headless schoolgirl - - private void Start() - { - Debug.Log("Anomaly 10 Started"); - SpawnAbnormalTile(); - } - - // Spawns the headless schoolgirl prefab at the specified location - private void SpawnAbnormalTile() - { - if (abnormalTilePrefab != null) - { - GameObject abnormalTileInstance = Instantiate(abnormalTilePrefab); - } - else - { - Debug.LogWarning("Prefab or spawn location not set for Anomaly10Manager."); - } - } -} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10_abnormalTile.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10_abnormalTile.cs index d8957f4..e9dc44c 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10_abnormalTile.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly10_abnormalTile.cs @@ -1,47 +1,63 @@ using UnityEngine; using System.Collections; -public class Anomaly10_abnormalTile : InteractableObject, IInteractable +public class Anomaly10_abnormalTile : AbstractAnomalyInteractable { - private bool hasInteracted = false; // Ensures only one interaction occurs - private AudioSource audioSource; // Reference to the AudioSource component - private void Start() + // 클래스 이름 + public override string Name { get; } = "Anomaly10_abnormalTile"; + + // 상호작용 시 실행될 메서드 + public override void OnInteract() { + base.OnInteract(); + + Log("Call `GameManager.SetStageClear` begin"); + GameManager.Instance.SetStageClear(); + Log("Call `GameManager.SetStageClear` end"); + + // Code used before `GameManager` updates begin + GameObject controllerObject = GameObject.Find("AnomalyManager (10)(Clone)"); + AbstractAnomalyObject controller = controllerObject.GetComponent(); + + Log($"Call `{controller.Name}.ResetAnomaly` begin"); + if (controller.ResetAnomaly()) { + Log($"Call `{controller.Name}.ResetAnomaly` success"); + } else { + Log($"Call `{controller.Name}.ResetAnomaly` failed", mode: 1); + } + // Code used before `GameManager` updates end + } + + // 필드를 초기화하는 메서드 + protected override bool InitFields() + { + bool res = base.InitFields(); + // Try to get the AudioSource component attached to this object audioSource = GetComponent(); if (audioSource == null) { Debug.LogError("AudioSource component is missing! Please attach an AudioSource to this object."); + res = false; } - } - - // Returns the prompt text for interaction (e.g., displayed on cursor) - public string GetInteractionPrompt() - { - return "Press Left Click to interact with the figure"; - } - // Determines if interaction is currently possible - public bool CanInteract(float distance) - { - return !hasInteracted; // Interaction is allowed only once + return res; } - // modified by 신채환 - // CanInteract 메서드가 거리를 인자로 받도록 변경 - // Handles interaction with the object - public void OnInteract() + // 이상현상을 초기화하는 메서드 + public override bool ResetAnomaly() { - if (hasInteracted) return; // Ensure interaction only happens once + bool res = base.ResetAnomaly(); - hasInteracted = true; - StartCoroutine(FadeOutAndClearStage(gameObject, 2f)); // Fades out over 2 seconds and then clears stage + StartCoroutine(FadeOut(gameObject, 2f)); // Fades out over 2 seconds and then clears stage + + return res; } // Coroutine to gradually fade out, destroy the object, and set the stage clear - private IEnumerator FadeOutAndClearStage(GameObject obj, float duration) + private IEnumerator FadeOut(GameObject obj, float duration) { // Play the sound once when the object starts fading out if (audioSource != null) @@ -74,7 +90,5 @@ private IEnumerator FadeOutAndClearStage(GameObject obj, float duration) Destroy(obj); // Remove the object completely after fading out - // Mark the stage as clear after the object is fully faded out - GameManager.Instance.SetStageClear(); } -} +} \ No newline at end of file diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Controller.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Controller.cs new file mode 100644 index 0000000..efbc330 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Controller.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +public class Anomaly11Controller : AbstractAnomalyComposite +{ + // 클래스 이름 + public override string Name { get; } = "Anomaly11Controller"; + + // `Awake` 메시지 용 메서드 + protected override bool Awake_() + { + bool res = base.Awake_(); + + // Code used before `GameManager` updates begin + Log("Call `StartAnomaly` begin"); + if (StartAnomaly()) { + Log("Call `StartAnomaly` success"); + } else { + Log("Call `StartAnomaly` failed", mode: 1); + res = false; + } + // Code used before `GameManager` updates end + + return res; + } +} \ No newline at end of file diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Manager.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Controller.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Manager.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Controller.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Manager.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Manager.cs deleted file mode 100644 index 72aeb5c..0000000 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11Manager.cs +++ /dev/null @@ -1,32 +0,0 @@ -using UnityEngine; - -public class Anomaly11Manager : MonoBehaviour -{ - public string targetDoorName = "door"; // 기존 문 오브젝트의 이름 - public GameObject doorOpenedPrefab; // 문이 열린 상태의 프리팹 - - private void Start() - { - GameObject targetDoor = GameObject.Find(targetDoorName); - if (targetDoor != null) - { - Destroy(targetDoor); - Debug.Log($"Anomaly 11: Found and removed target door {targetDoorName}"); - } - else - { - Debug.LogWarning($"Anomaly 11: Target door {targetDoorName} not found in the scene."); - } - - // 새로운 문 프리팹 소환 - if (doorOpenedPrefab != null) - { - Instantiate(doorOpenedPrefab); - Debug.Log("Anomaly 11: Spawned opened door prefab."); - } - else - { - Debug.LogError("Anomaly 11: doorOpenedPrefab is not assigned."); - } - } -} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_normaldoor.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_normaldoor.cs new file mode 100644 index 0000000..3219ce1 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_normaldoor.cs @@ -0,0 +1,32 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Anomaly11_normaldoor : AbstractAnomalyObject +{ + /********** + * fields * + **********/ + + /************** + * properties * + **************/ + + // 클래스 이름 + public override string Name { get; } = "Anomaly11_normaldoor"; + + /***************************************** + * implementation: AbstractAnomalyObject * + *****************************************/ + + // 이상현상을 시작하는 메서드 + public override bool StartAnomaly() + { + bool res = base.StartAnomaly(); + + gameObject.SetActive(false); + Log("Deleted normal door."); + + return res; + } +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_normaldoor.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_normaldoor.cs.meta new file mode 100644 index 0000000..3d2b240 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_normaldoor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48c9e4b5058bb344389c1cfed59a4c2e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_openeddoor.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_openeddoor.cs index 5070ddf..2904106 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_openeddoor.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly11_openeddoor.cs @@ -2,23 +2,65 @@ using UnityEngine.UI; using System.Collections; -public class Anomaly11_openeddoor : InteractableObject, IInteractable +public class Anomaly11_openeddoor : AbstractAnomalyInteractable { + [SerializeField] private Image fadeImage; - [SerializeField] private float fadeSpeed = 0.5f; - public float closeSpeed = 1.0f; // Door movement speed + [SerializeField] private float fadeSpeed; + public float closeSpeed; // Door movement speed private Transform movingPart; // Reference to Cube.002 child object private AudioSource audioSource; // Reference to AudioSource component - private bool hasInteracted = false; - private void Start() + // 클래스 이름 + public override string Name { get; } = "Anomaly11_openeddoor"; // TODO: 클래스 이름 추가하기. + + // 상호작용 시 실행될 메서드 + public override void OnInteract() + { + base.OnInteract(); + + Log("Call `GameManager.SetStageClear` begin"); + GameManager.Instance.SetStageClear(); + Log("Call `GameManager.SetStageClear` end"); + + // Code used before `GameManager` updates begin + GameObject controllerObject = GameObject.Find("AnomalyManager (11)(Clone)"); + AbstractAnomalyObject controller = controllerObject.GetComponent(); + + Log($"Call `{controller.Name}.ResetAnomaly` begin"); + if (controller.ResetAnomaly()) { + Log($"Call `{controller.Name}.ResetAnomaly` success"); + } else { + Log($"Call `{controller.Name}.ResetAnomaly` failed", mode: 1); + } + } + + // `Awake` 메시지 용 메서드 + protected override bool Awake_() + { + bool res = base.Awake_(); + + // TODO: `Awake` 메시지에서 해야할 것 넣기. 없으면 메서드를 아예 지워도 됨. + // 함수가 제대로 작동했으면 `true`를, 아니면 `false`를 반환. + + return res; + } + + // 필드를 초기화하는 메서드 + protected override bool InitFields() { + bool res = base.InitFields(); + + fadeSpeed = 0.5f; + closeSpeed = 1.0f; + // Locate Cube.002 within the door_opened prefab movingPart = transform.Find("Cube.002"); if (movingPart == null) { Debug.LogError("Anomaly11_openeddoor: 'Cube.002' not found as a child object."); + res = false; } // Locate AudioSource component on the GameObject @@ -26,35 +68,33 @@ private void Start() if (audioSource == null) { Debug.LogWarning("Anomaly11_openeddoor: AudioSource component is missing."); + res = false; } - } - // Returns the prompt text for interaction - public string GetInteractionPrompt() - { - return "Press Left Click to interact with the opened door"; + return res; } - // Determines if interaction is currently possible - public bool CanInteract(float distance) + // 이상현상을 시작하는 메서드 + public override bool StartAnomaly() { - return movingPart != null && !hasInteracted; + bool res = base.StartAnomaly(); + + // TODO: 이상현상 시작하는 코드 넣기. 없으면 메서드를 아예 지워도 됨. + // 함수가 제대로 작동했으면 `true`를, 아니면 `false`를 반환. + + return res; } - // modified by 신채환 - // CanInteract 메서드가 거리를 인자로 받도록 변경 - // Handles interaction with the opened door - public void OnInteract() + // 이상현상을 초기화하는 메서드 + public override bool ResetAnomaly() { - if (hasInteracted) return; // Ensure interaction only happens once - - hasInteracted = true; // Mark interaction as complete + bool res = base.ResetAnomaly(); // Start moving the door if (movingPart != null) { StartCoroutine(CloseDoor()); - } + } // Play AudioSource if available if (audioSource != null) @@ -62,11 +102,9 @@ public void OnInteract() audioSource.Play(); } - // Mark the stage as cleared - GameManager.Instance.SetStageClear(); + return res; } - // Coroutine to smoothly move the door in the z-axis private IEnumerator CloseDoor() { Vector3 startPosition = movingPart.localPosition; @@ -132,4 +170,4 @@ private IEnumerator StartFakeEnding(GameObject player) playerController.GameOver(); } } -} +} \ No newline at end of file diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Controller.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Controller.cs new file mode 100644 index 0000000..e69dd32 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Controller.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +public class Anomaly12Controller : AbstractAnomalyComposite +{ + // 클래스 이름 + public override string Name { get; } = "Anomaly12Controller"; + + // `Awake` 메시지 용 메서드 + protected override bool Awake_() + { + bool res = base.Awake_(); + + // Code used before `GameManager` updates begin + Log("Call `StartAnomaly` begin"); + if (StartAnomaly()) { + Log("Call `StartAnomaly` success"); + } else { + Log("Call `StartAnomaly` failed", mode: 1); + res = false; + } + // Code used before `GameManager` updates end + + return res; + } +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Manager.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Controller.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Manager.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Controller.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Manager.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Manager.cs deleted file mode 100644 index 47f7c2e..0000000 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12Manager.cs +++ /dev/null @@ -1,39 +0,0 @@ -using UnityEngine; - -public class Anomaly12Manager : MonoBehaviour -{ - public string targetLightName = "light (4)"; // 특정 조명의 이름 - public GameObject tiltedLightPrefab; // 기울어진 조명 프리팹 - - private void Start() - { - // 특정 조명 오브젝트 찾기 - GameObject targetLight = GameObject.Find(targetLightName); - - if (targetLight != null) - { - // World 위치와 회전 값 저장 - Vector3 lightPosition = targetLight.transform.position; - Quaternion lightRotation = tiltedLightPrefab.transform.rotation; - - // 기존 조명 오브젝트 제거 - Destroy(targetLight); - Debug.Log($"Anomaly 12: Found and removed target light {targetLightName}"); - - // 기울어진 조명 프리팹을 world 위치에 소환 - if (tiltedLightPrefab != null) - { - Instantiate(tiltedLightPrefab, lightPosition, lightRotation); - Debug.Log("Anomaly 12: Spawned tilted light prefab at target's world position."); - } - else - { - Debug.LogError("Anomaly 12: tiltedLightPrefab is not assigned."); - } - } - else - { - Debug.LogWarning($"Anomaly 12: Target light {targetLightName} not found in the scene."); - } - } -} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_normallight.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_normallight.cs new file mode 100644 index 0000000..9f9746c --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_normallight.cs @@ -0,0 +1,32 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Anomaly12_normallight : AbstractAnomalyObject +{ + /********** + * fields * + **********/ + + /************** + * properties * + **************/ + + // 클래스 이름 + public override string Name { get; } = "Anomaly12_normallight"; + + /***************************************** + * implementation: AbstractAnomalyObject * + *****************************************/ + + // 이상현상을 시작하는 메서드 + public override bool StartAnomaly() + { + bool res = base.StartAnomaly(); + + gameObject.SetActive(false); + Log("Deleted normal light."); + + return res; + } +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_normallight.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_normallight.cs.meta new file mode 100644 index 0000000..d6bca2f --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_normallight.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4105322dccdeddd4e9b964be20fc04d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_tiltedlight.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_tiltedlight.cs index 50fdccf..6c50e75 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_tiltedlight.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly12_tiltedlight.cs @@ -1,40 +1,56 @@ using UnityEngine; using System.Collections; -public class Anomaly12_tiltedlight : InteractableObject, IInteractable +public class Anomaly12_tiltedlight : AbstractAnomalyInteractable { - public float rotationSpeed = 1.0f; // 조명이 회전하는 속도 - private bool hasInteracted = false; - // Returns the prompt text for interaction - public string GetInteractionPrompt() + public float rotationSpeed; // 조명이 회전하는 속도 + + // 클래스 이름 + public override string Name { get; } = "Anomaly12_tiltedlight"; + + // 상호작용 시 실행될 메서드 + public override void OnInteract() { - return "Press Left Click to interact with the tilted light"; + base.OnInteract(); + + Log("Call `GameManager.SetStageClear` begin"); + GameManager.Instance.SetStageClear(); + Log("Call `GameManager.SetStageClear` end"); + + // Code used before `GameManager` updates begin + GameObject controllerObject = GameObject.Find("AnomalyManager (12)(Clone)"); + AbstractAnomalyObject controller = controllerObject.GetComponent(); + + Log($"Call `{controller.Name}.ResetAnomaly` begin"); + if (controller.ResetAnomaly()) { + Log($"Call `{controller.Name}.ResetAnomaly` success"); + } else { + Log($"Call `{controller.Name}.ResetAnomaly` failed", mode: 1); + } } - // Determines if interaction is currently possible - public bool CanInteract(float distance) + // 필드를 초기화하는 메서드 + protected override bool InitFields() { - return !hasInteracted; // 한 번만 상호작용 가능 + bool res = base.InitFields(); + + rotationSpeed = 1.0f; + + return res; } - // modified by 신채환 - // CanInteract 메서드가 거리를 인자로 받도록 변경 - // Handles interaction with the tilted light - public void OnInteract() + // 이상현상을 초기화하는 메서드 + public override bool ResetAnomaly() { - if (hasInteracted) return; // 상호작용은 한 번만 일어남 - - hasInteracted = true; // 상호작용 상태로 설정 + bool res = base.ResetAnomaly(); // 조명이 원상태로 돌아오도록 회전 시작 StartCoroutine(RotateLight()); - // 스테이지 클리어 상태로 설정 - GameManager.Instance.SetStageClear(); + return res; } - // Coroutine to smoothly rotate the light to (0, 0, 0) on the y-axis private IEnumerator RotateLight() { Quaternion startRotation = transform.rotation; diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Controller.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Controller.cs new file mode 100644 index 0000000..4ee42b1 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Controller.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +public class Anomaly13Controller : AbstractAnomalyComposite +{ + // 클래스 이름 + public override string Name { get; } = "Anomaly13Controller"; + + // `Awake` 메시지 용 메서드 + protected override bool Awake_() + { + bool res = base.Awake_(); + + // Code used before `GameManager` updates begin + Log("Call `StartAnomaly` begin"); + if (StartAnomaly()) { + Log("Call `StartAnomaly` success"); + } else { + Log("Call `StartAnomaly` failed", mode: 1); + res = false; + } + // Code used before `GameManager` updates end + + return res; + } +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Manager.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Controller.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Manager.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Controller.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Manager.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Manager.cs deleted file mode 100644 index 861f6db..0000000 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13Manager.cs +++ /dev/null @@ -1,35 +0,0 @@ -using UnityEngine; - -public class Anomaly13Manager : MonoBehaviour -{ - public string targetObjectName = "sitGirl"; // 삭제할 게임 오브젝트 이름 - public GameObject lookingGirlPrefab, eyesPrefab; // 소환할 프리팹 - - private void Start() - { - // 특정 이름의 게임 오브젝트 찾기 - GameObject targetObject = GameObject.Find(targetObjectName); - if (targetObject != null) - { - // 삭제 - Destroy(targetObject); - Debug.Log($"Anomaly 13: Found and removed target object {targetObjectName}"); - } - else - { - Debug.LogWarning($"Anomaly 13: Target object {targetObjectName} not found in the scene."); - } - - // 프리팹 소환 - if (lookingGirlPrefab != null) - { - Instantiate(lookingGirlPrefab); - Instantiate(eyesPrefab); - Debug.Log("Anomaly 13: Spawned looking girl prefab."); - } - else - { - Debug.LogError("Anomaly 13: lookingGirlPrefab is not assigned."); - } - } -} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_lookingeye.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_lookingeye.cs index 65c6e30..637d0ed 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_lookingeye.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_lookingeye.cs @@ -1,18 +1,46 @@ using UnityEngine; -public class Anomaly13_lookingeye : InteractableObject, IInteractable +public class Anomaly13_lookingeye : AbstractAnomalyInteractable { private Transform player; // 플레이어의 Transform (예: Main Camera) private Transform leftEye; // Left Eye Transform private Transform rightEye; // Right Eye Transform - private float rotationOffsetX = -90f; // LookAt 회전 보정 (X축) - private bool hasInteracted = false; // 상호작용 상태 확인 + private float rotationOffsetX; // LookAt 회전 보정 (X축) private Quaternion initialLeftEyeRotation; // Left Eye 초기 회전값 private Quaternion initialRightEyeRotation; // Right Eye 초기 회전값 - private void Start() + // 클래스 이름 + public override string Name { get; } = "Anomaly13_lookingeye"; + + // 상호작용 시 실행될 메서드 + public virtual void OnInteract() + { + base.OnInteract(); + + Log("Call `GameManager.SetStageClear` begin"); + GameManager.Instance.SetStageClear(); + Log("Call `GameManager.SetStageClear` end"); + + // Code used before `GameManager` updates begin + GameObject controllerObject = GameObject.Find("AnomalyManager (13)(Clone)"); + AbstractAnomalyObject controller = controllerObject.GetComponent(); + + Log($"Call `{controller.Name}.ResetAnomaly` begin"); + if (controller.ResetAnomaly()) { + Log($"Call `{controller.Name}.ResetAnomaly` success"); + } else { + Log($"Call `{controller.Name}.ResetAnomaly` failed", mode: 1); + } + } + + // 필드를 초기화하는 메서드 + protected override bool InitFields() { + bool res = base.InitFields(); + + rotationOffsetX = -90f; + // 플레이어 찾기 if (player == null) { @@ -24,6 +52,7 @@ private void Start() else { Debug.LogError("Anomaly13_lookingeye: Player not found! Ensure the player has the 'MainCamera' tag."); + res = false; } } @@ -34,17 +63,19 @@ private void Start() if (leftEye == null || rightEye == null) { Debug.LogError("Anomaly13_lookingeye: Left or Right Eye not found as children of 'eyes'."); - return; + res = false; } // 초기 회전값 저장 initialLeftEyeRotation = leftEye.localRotation; initialRightEyeRotation = rightEye.localRotation; + + return res; } private void Update() { - if (!hasInteracted && player != null) + if (CanInteract(1f) && player != null) { // 플레이어를 바라보도록 회전 RotateEyesTowardsPlayer(); @@ -81,33 +112,14 @@ private void ResetEyeRotations() Debug.Log("Anomaly13_lookingeye: Eyes reset to initial rotations."); } - // 인터페이스 구현: 상호작용 가능 여부 반환 - public bool CanInteract(float distance) + // 이상현상을 초기화하는 메서드 + public override bool ResetAnomaly() { - return !hasInteracted; - } - // modified by 신채환 - // CanInteract 메서드가 거리를 인자로 받도록 변경 - - // 인터페이스 구현: 상호작용 시 표시할 텍스트 - public string GetInteractionPrompt() - { - return "Press Left Click to interact with the eyes."; - } - - // 인터페이스 구현: 상호작용 동작 - public void OnInteract() - { - if (hasInteracted) return; + bool res = base.ResetAnomaly(); - hasInteracted = true; - - // 눈의 회전을 초기화 ResetEyeRotations(); - - // 스테이지 클리어 처리 - GameManager.Instance.SetStageClear(); - Debug.Log("Anomaly13_lookingeye: Interaction complete, stage cleared."); + + return res; } } diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_normaleye.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_normaleye.cs new file mode 100644 index 0000000..d7bb932 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_normaleye.cs @@ -0,0 +1,32 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Anomaly13_normaleye : AbstractAnomalyObject +{ + /********** + * fields * + **********/ + + /************** + * properties * + **************/ + + // 클래스 이름 + public override string Name { get; } = "Anomaly13_normaleye"; + + /***************************************** + * implementation: AbstractAnomalyObject * + *****************************************/ + + // 이상현상을 시작하는 메서드 + public override bool StartAnomaly() + { + bool res = base.StartAnomaly(); + + gameObject.SetActive(false); + Log("Deleted normal eye."); + + return res; + } +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_normaleye.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_normaleye.cs.meta new file mode 100644 index 0000000..7cfaa16 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly13_normaleye.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a55ff71c373727419603887e590ca1a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Controller.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Controller.cs new file mode 100644 index 0000000..679430a --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Controller.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +public class Anomaly21Controller : AbstractAnomalyComposite +{ + // 클래스 이름 + public override string Name { get; } = "Anomaly21Controller"; + + // `Awake` 메시지 용 메서드 + protected override bool Awake_() + { + bool res = base.Awake_(); + + // Code used before `GameManager` updates begin + Log("Call `StartAnomaly` begin"); + if (StartAnomaly()) { + Log("Call `StartAnomaly` success"); + } else { + Log("Call `StartAnomaly` failed", mode: 1); + res = false; + } + // Code used before `GameManager` updates end + + return res; + } +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Manager.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Controller.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Manager.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Controller.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Manager.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Manager.cs deleted file mode 100644 index 5312bfc..0000000 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21Manager.cs +++ /dev/null @@ -1,34 +0,0 @@ -using UnityEngine; - -public class Anomaly21Manager : MonoBehaviour -{ - public string targetObjectName = "professor_normal"; // 삭제할 게임 오브젝트 이름 - public GameObject professorPrefab; // 소환할 프리팹 - - private void Start() - { - // 특정 이름의 게임 오브젝트 찾기 - GameObject targetObject = GameObject.Find(targetObjectName); - if (targetObject != null) - { - // 삭제 - Destroy(targetObject); - Debug.Log($"Anomaly 21: Found and removed target object {targetObjectName}"); - } - else - { - Debug.LogWarning($"Anomaly 21: Target object {targetObjectName} not found in the scene."); - } - - // 프리팹 소환 - if (professorPrefab != null) - { - Instantiate(professorPrefab); - Debug.Log("Anomaly 21: Spawned chasing professor prefab."); - } - else - { - Debug.LogError("Anomaly 21: professorPrefab is not assigned."); - } - } -} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_chase.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_chase.cs index a1cd9b0..2ea1ff1 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_chase.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_chase.cs @@ -7,12 +7,13 @@ [RequireComponent(typeof(NavMeshAgent))] [RequireComponent(typeof(CapsuleCollider))] [RequireComponent(typeof(AudioSource))] -public class Anomaly21_chase : MonoBehaviour + +public class Anomaly21_chase : AbstractAnomalyInteractable { - public float chaseSpeed = 4f; - public float returnSpeed = 2f; - public float chaseDistance = 10f; - public float fadeOutDuration = 4f; + public float chaseSpeed; + public float returnSpeed; + public float chaseDistance; + public float fadeOutDuration; public Transform startPoint; private bool isChasing = false; private bool canChase = true; @@ -28,8 +29,20 @@ public class Anomaly21_chase : MonoBehaviour private GameObject unityIcon; private float elapsedTime = 0f; - void Start() + // 클래스 이름 + public override string Name { get; } = "Anomaly13_lookingeye"; + + + // 필드를 초기화하는 메서드 + protected override bool InitFields() { + bool res = base.InitFields(); + + chaseSpeed = 4f; + returnSpeed = 2f; + chaseDistance = 10f; + fadeOutDuration = 4f; + player = GameObject.FindWithTag("Player").transform; navAgent = GetComponent(); animator = GetComponent(); @@ -46,9 +59,11 @@ void Start() audioSource.loop = true; audioSource.playOnAwake = false; + + return res; } - void Update() + private void Update() { if (!canChase) return; @@ -76,7 +91,7 @@ void Update() if (elapsedTime >= 20f) { - StartCoroutine(ReturnToStart()); + ResetAnomaly(); } } } @@ -154,4 +169,15 @@ private void LockPositionAndRotation() rb.angularVelocity = Vector3.zero; rb.isKinematic = true; } + + // 이상현상을 초기화하는 메서드 + public override bool ResetAnomaly() + { + bool res = base.ResetAnomaly(); + + StartCoroutine(ReturnToStart()); + Debug.Log("Anomaly21_chase: Stage Cleared."); + + return res; + } } diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_normalprofessor.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_normalprofessor.cs new file mode 100644 index 0000000..5aad537 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_normalprofessor.cs @@ -0,0 +1,32 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Anomaly21_normalprofessor : AbstractAnomalyObject +{ + /********** + * fields * + **********/ + + /************** + * properties * + **************/ + + // 클래스 이름 + public override string Name { get; } = "Anomaly21_normalprofessor"; + + /***************************************** + * implementation: AbstractAnomalyObject * + *****************************************/ + + // 이상현상을 시작하는 메서드 + public override bool StartAnomaly() + { + bool res = base.StartAnomaly(); + + gameObject.SetActive(false); + Log("Deleted normal eye."); + + return res; + } +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_normalprofessor.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_normalprofessor.cs.meta new file mode 100644 index 0000000..c4d1ca9 --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly21_normalprofessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6aa0d459c4e2b834fad9092d089c5c87 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Controller.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Controller.cs new file mode 100644 index 0000000..6bd931d --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Controller.cs @@ -0,0 +1,69 @@ +using UnityEngine; + +public class Anomaly24Controller : AbstractAnomalyComposite +{ + public GameObject prefab; + private Transform[] childTransforms; + GameObject sitGirls; + + // `Awake` 메시지 용 메서드 + protected override bool Awake_() + { + bool res = base.Awake_(); + + // Code used before `GameManager` updates begin + Log("Call `StartAnomaly` begin"); + if (StartAnomaly()) { + Log("Call `StartAnomaly` success"); + } else { + Log("Call `StartAnomaly` failed", mode: 1); + res = false; + } + // Code used before `GameManager` updates end + + return res; + } + + // 필드를 초기화하는 메서드 + protected override bool InitFields() + { + bool res = base.InitFields(); + + if (sitGirls != null) + { + childTransforms = new Transform[sitGirls.transform.childCount]; + for (int i = 0; i < sitGirls.transform.childCount; i++) + { + childTransforms[i] = sitGirls.transform.GetChild(i); + } + + foreach (Transform childTransform in childTransforms) + { + Vector3 newPosition = new Vector3( + childTransform.position.x, + childTransform.position.y + 2, // Y 좌표에 2 추가 + childTransform.position.z + ); + + Instantiate(prefab, newPosition, childTransform.rotation); + } + } + else + { + Debug.LogError("SitGirls object not found!"); + res = false; + } + + return res; + } + // 이상현상을 시작하는 메서드 + public override bool StartAnomaly() + { + bool res = base.StartAnomaly(); + + Destroy(sitGirls); + + return res; + } + +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Manager.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Controller.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Manager.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Controller.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Manager.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Manager.cs deleted file mode 100644 index 1d0dc98..0000000 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24Manager.cs +++ /dev/null @@ -1,37 +0,0 @@ -using UnityEngine; - -public class Anomaly24Manager : MonoBehaviour -{ - public GameObject prefab; - private Transform[] childTransforms; - - void Start() - { - GameObject sitGirls = GameObject.Find("SitGirls"); - if (sitGirls != null) - { - childTransforms = new Transform[sitGirls.transform.childCount]; - for (int i = 0; i < sitGirls.transform.childCount; i++) - { - childTransforms[i] = sitGirls.transform.GetChild(i); - } - - Destroy(sitGirls); - - foreach (Transform childTransform in childTransforms) - { - Vector3 newPosition = new Vector3( - childTransform.position.x, - childTransform.position.y + 2, // Y 좌표에 2 추가 - childTransform.position.z - ); - - Instantiate(prefab, newPosition, childTransform.rotation); - } - } - else - { - Debug.LogError("SitGirls object not found!"); - } - } -} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24_luciddream.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24_luciddream.cs index 152fcc2..e522da3 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24_luciddream.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly24_luciddream.cs @@ -2,23 +2,41 @@ using System.Collections; [RequireComponent(typeof(AudioSource))] -public class Anomaly24_luciddream : MonoBehaviour +public class Anomaly24_luciddream : AbstractAnomalyInteractable { [SerializeField] private float duration = 30f; private AudioSource audioSource; private Transform mainCamera; - void Start() + // 클래스 이름 + public override string Name { get; } = "Anomaly24_luciddream"; + + + // 필드를 초기화하는 메서드 + protected override bool InitFields() { + bool res = base.InitFields(); + audioSource = GetComponent(); mainCamera = Camera.main?.transform; if (mainCamera == null) { Debug.LogError("Main Camera not found!"); + res = false; } + return res; + } + + // 이상현상을 시작하는 메서드 + public override bool StartAnomaly() + { + bool res = base.StartAnomaly(); + StartCoroutine(LucidDreamSequence()); + + return res; } private IEnumerator LucidDreamSequence() @@ -78,3 +96,4 @@ private IEnumerator FadeOutAudio() audioSource.volume = startVolume; } } + diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Controller.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Controller.cs new file mode 100644 index 0000000..013752d --- /dev/null +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Controller.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Anomaly27Controller : AbstractAnomalyComposite +{ + + public override string Name { get; } = "Anomaly27Controller"; // 소환할 프리팹 + + // `Awake` 메시지 용 메서드 + protected override bool Awake_() + { + bool res = base.Awake_(); + + // Code used before `GameManager` updates begin + Log("Call `StartAnomaly` begin"); + if (StartAnomaly()) { + Log("Call `StartAnomaly` success"); + } else { + Log("Call `StartAnomaly` failed", mode: 1); + res = false; + } + // Code used before `GameManager` updates end + + + return res; + } +} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Manager.cs.meta b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Controller.cs.meta similarity index 100% rename from 302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Manager.cs.meta rename to 302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Controller.cs.meta diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Manager.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Manager.cs deleted file mode 100644 index 9e23236..0000000 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27Manager.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class Anomaly27Manager : MonoBehaviour -{ - public GameObject clockPrefab; // 소환할 프리팹 - - private void Start() - { - // 프리팹 소환 - if (clockPrefab != null) - { - Instantiate(clockPrefab); - Debug.Log("Anomaly 27: Spawned magnifying clock prefab."); - } - else - { - Debug.LogError("Anomaly 27: clockPrefab is not assigned."); - } - } -} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27_magnifyingclock.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27_magnifyingclock.cs index bc0ca91..da7d6e0 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27_magnifyingclock.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly27_magnifyingclock.cs @@ -1,16 +1,26 @@ using UnityEngine; [RequireComponent(typeof(Collider))] -public class Anomaly27_magnifyingclock : MonoBehaviour +public class Anomaly27_magnifyingclock : AbstractAnomalyInteractable { - [SerializeField] private float scaleIncreaseRate = 0.1f; // 초당 증가할 스케일 크기 - [SerializeField] private float scaleStartDelay = 5f; // 스케일 증가 시작 딜레이 - private bool isScaling = false; // 스케일 증가 여부 + + public override string Name { get; } = "Anomaly27_magnifyingclock"; + + [SerializeField] private float scaleIncreaseRate; // 초당 증가할 스케일 크기 + [SerializeField] private float scaleStartDelay; // 스케일 증가 시작 딜레이 + private bool isScaling; // 스케일 증가 여부 private bool isStageClear = true; private Collider objectCollider; - void Start() + // 필드를 초기화하는 메서드 + protected override bool InitFields() { + bool res = base.InitFields(); + + scaleIncreaseRate = 0.1f; + scaleStartDelay = 5f; + isScaling = false; + GameManager.Instance.SetStageClear(); // 시작 시 스테이지 클리어 설정 isStageClear = true; objectCollider = GetComponent(); @@ -18,6 +28,8 @@ void Start() // 5초 후 스케일 증가 시작 Invoke(nameof(StartScaling), scaleStartDelay); + + return res; } void Update() diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly3Manager.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly3Manager.cs deleted file mode 100644 index ac6b76e..0000000 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly3Manager.cs +++ /dev/null @@ -1,23 +0,0 @@ -using UnityEngine; -public class Anomaly3Manager : MonoBehaviour -{ - public GameObject headlessSchoolgirlPrefab; // Prefab for the headless schoolgirl - private void Start() - { - Debug.Log("Anomaly 3 Started"); - SpawnHeadlessSchoolgirl(); - } - // Spawns the headless schoolgirl prefab at the specified location - private void SpawnHeadlessSchoolgirl() - { - if (headlessSchoolgirlPrefab != null) - { - GameObject headlessSchoolgirlInstance = Instantiate(headlessSchoolgirlPrefab, transform.position, transform.rotation); - } - else - { - Debug.LogWarning("Prefab or spawn location not set for Anomaly3Manager."); - } - } - -} diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly8Manager.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly8Manager.cs deleted file mode 100644 index 2428d9f..0000000 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly8Manager.cs +++ /dev/null @@ -1,30 +0,0 @@ -using UnityEngine; - -public class Anomaly8Manager : MonoBehaviour -{ - public string normalProfessorPrefabName = "professor_normal"; // The GameObject to be destroyed - public GameObject micSoundProfessorPrefab; // The prefab to spawn after destroying the target - - private void Start() - { - GameObject normalProfessorPrefab = GameObject.Find(normalProfessorPrefabName); - if (normalProfessorPrefab != null && micSoundProfessorPrefab != null) - { - // Store the position and rotation of the target before destroying it - Vector3 spawnPosition = normalProfessorPrefab.transform.position; - Quaternion spawnRotation = normalProfessorPrefab.transform.rotation; - - // Destroy the target object - Destroy(normalProfessorPrefab); - - // Instantiate the replacement prefab at the target's position - Instantiate(micSoundProfessorPrefab, spawnPosition, spawnRotation); - - Debug.Log("Anomaly 8 triggered: Target destroyed and replacement spawned."); - } - else - { - Debug.LogWarning("Target object or replacement prefab is not set in Anomaly8Manager."); - } - } -}