From 6e83ab6a199ae7a8a5272b0c6c45043f03432f5b Mon Sep 17 00:00:00 2001 From: Prown0 <100746335+Prown0@users.noreply.github.com> Date: Tue, 3 Dec 2024 01:19:31 +0900 Subject: [PATCH] Code cleaning & bug fix --- 302/Assets/Scenes/DefaultGameScene.unity | 20 ++++++++++++++++++- 302/Assets/Scripts/GameManager.cs | 10 ++++++++++ 302/Assets/Scripts/SCH_AnomalyManager.cs | 1 + .../Anomaly18_Object.cs | 13 ++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/302/Assets/Scenes/DefaultGameScene.unity b/302/Assets/Scenes/DefaultGameScene.unity index e6dcda4..8a14339 100644 --- a/302/Assets/Scenes/DefaultGameScene.unity +++ b/302/Assets/Scenes/DefaultGameScene.unity @@ -21335,7 +21335,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6485073249332333076, guid: b49efed64fd3d8d439cfd1de3a9808f5, type: 3} propertyPath: m_LocalPosition.x - value: -9.65 + value: -9.91 objectReference: {fileID: 0} - target: {fileID: 6485073249332333076, guid: b49efed64fd3d8d439cfd1de3a9808f5, type: 3} propertyPath: m_LocalPosition.y @@ -37858,6 +37858,24 @@ Transform: m_CorrespondingSourceObject: {fileID: 7236329420339151181, guid: 2ad42fc20dee64e4ca84470ffa3fb42e, type: 3} m_PrefabInstance: {fileID: 1775610000} m_PrefabAsset: {fileID: 0} +--- !u!1 &1775610002 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8009453923108019191, guid: 2ad42fc20dee64e4ca84470ffa3fb42e, type: 3} + m_PrefabInstance: {fileID: 1775610000} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1775610003 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1775610002} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5dc5b8d84ca9e044194aa4abaf491948, type: 3} + m_Name: + m_EditorClassIdentifier: + position: {x: -5.83, y: 0.72, z: 13.4} --- !u!1001 &1779680312 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/302/Assets/Scripts/GameManager.cs b/302/Assets/Scripts/GameManager.cs index 3150519..c1c3801 100644 --- a/302/Assets/Scripts/GameManager.cs +++ b/302/Assets/Scripts/GameManager.cs @@ -67,6 +67,16 @@ public void SetStageNoClear() // 플레이어가 Sleep 선택 시 호출 public void Sleep() { + // Added by 신 채 환 + // 시계 초기화 + GameObject clock = GameObject.Find("clock"); + if (clock != null) { + Anomaly18_Object script = clock.GetComponent(); + if (script != null && script.enabled) { + script.ResetAnomalyNow(); + } + } + gameState = GameState.Sleeping; if (currentStageClear) { diff --git a/302/Assets/Scripts/SCH_AnomalyManager.cs b/302/Assets/Scripts/SCH_AnomalyManager.cs index 5fe199f..10974e6 100644 --- a/302/Assets/Scripts/SCH_AnomalyManager.cs +++ b/302/Assets/Scripts/SCH_AnomalyManager.cs @@ -128,6 +128,7 @@ protected virtual bool InitObjects() SCH_AnomalyObject obj = gameObj.GetComponent(); if (obj != null) { + obj.enabled = true; obj.Manager = this; objects.Add(obj); Log($"Find `{name}` success: {obj.Name}"); diff --git a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly18_Object.cs b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly18_Object.cs index a019a69..be71a1a 100644 --- a/302/Assets/Scripts/SpecificAnomalyManager/Anomaly18_Object.cs +++ b/302/Assets/Scripts/SpecificAnomalyManager/Anomaly18_Object.cs @@ -53,6 +53,19 @@ public override bool ResetAnomaly() * new methods * ***************/ + // 이상현상을 바로 초기화하는 메서드 + public bool ResetAnomalyNow() + { + bool res = true; + + transform.position = position + direction * valueNormal; + Log("Set position success"); + + enabled = false; + + return res; + } + // 초기 위치부터 최종 위치까지 지속시간 동안 움직이는 메서드 private IEnumerator MoveAsync() {