Skip to content

Commit

Permalink
Merge pull request #179 from 2024FALL-SWPP/chaehwan/codeCleaning
Browse files Browse the repository at this point in the history
Chaehwan/code cleaning
  • Loading branch information
Prown0 authored Dec 2, 2024
2 parents 27ad8d2 + 6e83ab6 commit 251f1ad
Show file tree
Hide file tree
Showing 40 changed files with 432 additions and 498 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b3698bbfa0cfc4b73bc9dd4d3b8c5468, type: 3}
m_Name:
m_EditorClassIdentifier:
nameGameManager: GameManager
nameChair: chair (20)
names:
- chair (20)
prefabs:
- {fileID: 3766714381938235252, guid: 63dac8321736a9a4587f4fd967a5d0d8, type: 3}
nameChair:
prefabGirl: {fileID: 3766714381938235252, guid: 63dac8321736a9a4587f4fd967a5d0d8, type: 3}
positionChair: {x: -5.83, y: 0.72, z: 13.4}
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 921b5d489d0fd473a90b2648020b6981, type: 3}
m_Name:
m_EditorClassIdentifier:
nameWall: WallBack
nameClock: clock
positionWall: {x: 0, y: 0, z: 0}
positionClock: {x: -18.5, y: 7.06, z: 1.84}
directionWall: {x: -1, y: 0, z: 0}
directionClock: {x: -1, y: 0, z: 0}
positionNormal: 0
positionAnomaly: 6.6
prefabDesks: {fileID: 3135954807459457769, guid: d37030a3e9613de409491dab9c926a06, type: 3}
prefabChairs: {fileID: 2824771154171234484, guid: d314417c861d1174caaa974bcaeb1a14, type: 3}
prefabInteractables:
- {fileID: 6330698921243240140, guid: 67be1e6b104df81468a52f46aba49d8c, type: 3}
- {fileID: 8989905498966388834, guid: 6b079452df3a5da44aae624404efe648, type: 3}
- {fileID: 5419280097993429686, guid: 8009063ebbca7d14b9f119abdf467f48, type: 3}
- {fileID: 661700201260497465, guid: 147a5b1985730a849bd4568b4c7dd68d, type: 3}
- {fileID: 5839778339388796868, guid: e756aae9e6d5a2c4aa53edf63a90a73e, type: 3}
- {fileID: 1761092321075197500, guid: 189843821322f8d46a0c044b91aecd8a, type: 3}
names:
- WallBack
- clock
prefabs:
- {fileID: 3135954807459457769, guid: d37030a3e9613de409491dab9c926a06, type: 3}
- {fileID: 2824771154171234484, guid: d314417c861d1174caaa974bcaeb1a14, type: 3}
Expand All @@ -70,5 +56,5 @@ MonoBehaviour:
- {fileID: 661700201260497465, guid: 147a5b1985730a849bd4568b4c7dd68d, type: 3}
- {fileID: 5839778339388796868, guid: e756aae9e6d5a2c4aa53edf63a90a73e, type: 3}
- {fileID: 1761092321075197500, guid: 189843821322f8d46a0c044b91aecd8a, type: 3}
durationMove: 5
durationFade: 2
nameWall: WallBack
nameClock: clock
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ac9ccff8bcade466eaa77e3dfd322477, type: 3}
m_Name:
m_EditorClassIdentifier:
nameGameManager: GameManager
names:
- SlideRight
prefabs: []
nameSlide: SlideRight
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 71a8eeeaaa8fe4e91b0707e40548c7dc, type: 3}
m_Name:
m_EditorClassIdentifier:
nameGameManager: GameManager
names:
- LaptopFace
prefabs: []
nameLaptop: LaptopFace
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 085c515f4a72f447ca184b2322523ea7, type: 3}
m_Name:
m_EditorClassIdentifier:
nameGameManager: GameManager
names: []
prefabs:
- {fileID: 1585356450965799673, guid: f6f048eaa6cbbd149a13d00c9d48bd32, type: 3}
- {fileID: 6007555188655779168, guid: 0852fbf6270b3594ca9d568aa073d9f0, type: 3}
- {fileID: 6352980353013582430, guid: 0668cb8fc4c4adf4d89c5576aa49baa3, type: 3}
- {fileID: 8359328002521216368, guid: 20dd6377462426d459e214f2050cbf9e, type: 3}
prefabPlayer: {fileID: 1585356450965799673, guid: f6f048eaa6cbbd149a13d00c9d48bd32, type: 3}
prefabsInteractable:
- {fileID: 6007555188655779168, guid: 0852fbf6270b3594ca9d568aa073d9f0, type: 3}
- {fileID: 6352980353013582430, guid: 0668cb8fc4c4adf4d89c5576aa49baa3, type: 3}
- {fileID: 8359328002521216368, guid: 20dd6377462426d459e214f2050cbf9e, type: 3}
duration: 2
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 88057b82d9de4412ab8dbda29fc6b064, type: 3}
m_Name:
m_EditorClassIdentifier:
nameGameManager: GameManager
names:
- Laptop
prefabs:
- {fileID: 6383441288876432308, guid: 81c28fcb68ce14547b921480ce36bbed, type: 3}
nameLaptop: Laptop
prefabGhost: {fileID: 6383441288876432308, guid: 81c28fcb68ce14547b921480ce36bbed, type: 3}
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b5cacf602dde845d8a9e49737c5381f2, type: 3}
m_Name:
m_EditorClassIdentifier:
nameGameManager: GameManager
names: []
prefabs:
- {fileID: 1113413758793249629, guid: dae6286e84063a94a93a349b3da00e3f, type: 3}
prefabCake: {fileID: 1113413758793249629, guid: dae6286e84063a94a93a349b3da00e3f, type: 3}
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
14 changes: 12 additions & 2 deletions 302/Assets/Scripts/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private void Start()

// Added by 신 채 환
// 슬라이드 초기화
SlideManager.Instance.InitSlideList();
SlideManager.Instance.GenerateSlideList();
StartCoroutine(InitializeSlideAfterLoad());
}
private void InitializeGame()
Expand All @@ -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 All @@ -93,7 +103,7 @@ public void Sleep()

// Added by 신 채 환
// 슬라이드 색인 배열 재생성
SlideManager.Instance.InitSlideList();
SlideManager.Instance.GenerateSlideList();
}
currentStageClear = false; // 클리어 상태 초기화
LoadDefaultScene();
Expand Down
6 changes: 3 additions & 3 deletions 302/Assets/Scripts/LaptopFaceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ protected override bool InitFields()

// _colour
_colour = defaults[0].GetPixel(407, 297);
Log("Initialize `_colour`: success: "
Log("Initialize `_colour` success: "
+ $"Color({_colour.r}, {_colour.g}, {_colour.b}, {_colour.a})");

// _isGazing
_isGazing = false;
Log("Initialize `_isGazing`: success");
Log("Initialize `_isGazing` success");

// _tangent
_tangent = 0;
Log("Initialize `_tangent`: success");
Log("Initialize `_tangent` success");

return res;
}
Expand Down
14 changes: 8 additions & 6 deletions 302/Assets/Scripts/LaptopScreenController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,20 @@ public int Index {
}
}

/************
* messages *
************/
/*********************************
* implementation: SCH_Behaviour *
*********************************/

// This function is called when the object becomes enabled and active.
protected override void OnEnable()
// `Awake` 메시지 용 메서드
protected override bool Awake_()
{
base.OnEnable();
bool res = base.Awake_();

Log("Call `ResetScreen` begin");
ResetScreen();
Log("Call `ResetScreen` end");

return res;
}

/***********
Expand Down
22 changes: 16 additions & 6 deletions 302/Assets/Scripts/SCH_AnomalyInteractable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class SCH_AnomalyInteractable : SCH_AnomalyObject, IInteractable
public string prompt;
public float distanceInteractionMax;

// 기타 수치
// 내부 수치
protected bool canInteract;

/**************
Expand All @@ -34,14 +34,14 @@ public string GetInteractionPrompt()
// 상호작용 시 실행될 메서드
public void OnInteract()
{
Log("Interaction occurs.");
Log($"Interaction with `{gameObject.name}`");

if (Manager != null) {
Log("Call `Manager.InteractionSuccess` begin");
Log($"Call `{Manager.Name}.InteractionSuccess` begin");
Manager.InteractionSuccess();
Log("Call `Manager.InteractionSuccess` end");
Log($"Call `{Manager.Name}.InteractionSuccess` end");
} else {
Log("Call `Manager.InteractionSuccess`: failed", mode: 1);
Log($"Call `{Manager.Name}.InteractionSuccess` failed", mode: 1);
}

canInteract = false;
Expand All @@ -60,11 +60,21 @@ public bool CanInteract(float distance)
// 필드를 초기화하는 메서드
protected override bool InitFields()
{
Collider collider = GetComponent<Collider>();
bool res = base.InitFields();

// collider.isTrigger
if (collider != null) {
collider.isTrigger = false;
Log("Set `collider.isTrigger` success");
} else {
Log("Set `collider.isTrigger` failed", mode: 1);
res = false;
}

// canInteract
canInteract = true;
Log("Initialize `canInteract`: success");
Log("Initialize `canInteract` success");

return res;
}
Expand Down
Loading

0 comments on commit 251f1ad

Please sign in to comment.