Skip to content

Commit

Permalink
Code cleaning & bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Prown0 committed Dec 2, 2024
1 parent 842cbc4 commit 6e83ab6
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
20 changes: 19 additions & 1 deletion 302/Assets/Scenes/DefaultGameScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions 302/Assets/Scripts/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Anomaly18_Object>();
if (script != null && script.enabled) {
script.ResetAnomalyNow();
}
}

gameState = GameState.Sleeping;
if (currentStageClear)
{
Expand Down
1 change: 1 addition & 0 deletions 302/Assets/Scripts/SCH_AnomalyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ protected virtual bool InitObjects()
SCH_AnomalyObject obj = gameObj.GetComponent<SCH_AnomalyObject>();

if (obj != null) {
obj.enabled = true;
obj.Manager = this;
objects.Add(obj);
Log($"Find `{name}` success: {obj.Name}");
Expand Down
13 changes: 13 additions & 0 deletions 302/Assets/Scripts/SpecificAnomalyManager/Anomaly18_Object.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit 6e83ab6

Please sign in to comment.