Skip to content

Commit

Permalink
UIManager
Browse files Browse the repository at this point in the history
  • Loading branch information
jihu0331 committed Dec 17, 2024
1 parent 3750cd2 commit 17a91c0
Show file tree
Hide file tree
Showing 5 changed files with 277 additions and 43 deletions.
78 changes: 78 additions & 0 deletions Assets/SWPPT3/Prefabs/UI/Canvas/MainCanvas.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,63 @@ PrefabInstance:
propertyPath: m_Name
value: ExitGame
objectReference: {fileID: 0}
- target: {fileID: 7236431965086719357, guid: 61df03588f08547f6b5cd4965a087fca,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7236431965086719357, guid: 61df03588f08547f6b5cd4965a087fca,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7236431965086719357, guid: 61df03588f08547f6b5cd4965a087fca,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 1613120421189732451, guid: a2e6f40142dfb4348b3f738d36251b1a,
type: 3}
- target: {fileID: 7236431965086719357, guid: 61df03588f08547f6b5cd4965a087fca,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 7236431966328507960, guid: 61df03588f08547f6b5cd4965a087fca,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7236431966328507960, guid: 61df03588f08547f6b5cd4965a087fca,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7236431966328507960, guid: 61df03588f08547f6b5cd4965a087fca,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 1613120421189733276, guid: a2e6f40142dfb4348b3f738d36251b1a,
type: 3}
- target: {fileID: 7236431966328507960, guid: 61df03588f08547f6b5cd4965a087fca,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 7236431966328507960, guid: 61df03588f08547f6b5cd4965a087fca,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: ReturnStart
objectReference: {fileID: 0}
- target: {fileID: 7236431966328507960, guid: 61df03588f08547f6b5cd4965a087fca,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: SWPPT3.Main.Manager.UIManager, Main
objectReference: {fileID: 0}
- target: {fileID: 7236431966328507960, guid: 61df03588f08547f6b5cd4965a087fca,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 61df03588f08547f6b5cd4965a087fca, type: 3}
--- !u!224 &2734474183602666904 stripped
Expand Down Expand Up @@ -1322,6 +1379,27 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 4136735327766865086}
m_Modifications:
- target: {fileID: 475197679894968578, guid: 7c2934494b20d4952ad4a667ce88e87f,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 475197679894968578, guid: 7c2934494b20d4952ad4a667ce88e87f,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 475197679894968578, guid: 7c2934494b20d4952ad4a667ce88e87f,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 1613120421189732451, guid: a2e6f40142dfb4348b3f738d36251b1a,
type: 3}
- target: {fileID: 475197679894968578, guid: 7c2934494b20d4952ad4a667ce88e87f,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2545815646512713438, guid: 7c2934494b20d4952ad4a667ce88e87f,
type: 3}
propertyPath: m_Name
Expand Down
126 changes: 126 additions & 0 deletions Assets/SWPPT3/Scenes/Start.unity
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ Transform:
- {fileID: 692768423}
- {fileID: 107014579}
- {fileID: 2061965810}
- {fileID: 2140767896}
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -951,6 +952,131 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &2140767895
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1956572137}
m_Modifications:
- target: {fileID: 519183602932949858, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_Name
value: MainCanvas
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ffc3b6723b081b145ac40f5f139b7898, type: 3}
--- !u!224 &2140767896 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 4136735327766865086, guid: ffc3b6723b081b145ac40f5f139b7898,
type: 3}
m_PrefabInstance: {fileID: 2140767895}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &8801989720111576824
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
18 changes: 12 additions & 6 deletions Assets/SWPPT3/Scripts/Main/Manager/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public enum GameState
Paused,
OnChoice,
GameOver,
Exit,
StageCleared
}

Expand Down Expand Up @@ -56,31 +57,35 @@ private void HandleGameStateChanged(GameState newState)
switch (newState)
{
case GameState.BeforeStart:
UIManager.Instance.ShowStartStage();
break;
case GameState.Playing:
LoadScene(stageNumber);
stageManager?.StartStage();
break;
case GameState.Paused:
stageManager?.PauseStage();
break;
case GameState.GameOver:
stageManager?.FailStage();
UIManager.Instance.ShowFail();
break;
case GameState.OnChoice:

break;
case GameState.Exit:
break;
case GameState.StageCleared:
stageManager?.ClearStage();
ProceedToNextStage();
GameState = GameState.Playing;
UIManager.Instance.ShowClear();
break;
}
}

private void InitializeStage()
{
//loadingscene을 켜고
LoadScene(stageNumber);
LoadScene();
StageManager stageManager = StageManager.Instance;
if (stageManager != null)
{
Expand Down Expand Up @@ -133,8 +138,9 @@ public void StageSelect(int stageNum)
GameState = GameState.Playing;
}

public void LoadScene(int stageNum)
public void LoadScene()
{
UIManager.Instance.ShowPlaying();
string sceneName;
// if (stageNum > 2)
// {
Expand All @@ -144,7 +150,7 @@ public void LoadScene(int stageNum)
// {
// sceneName = $"Tutorial{stageNum}";
// }
switch (stageNum)
switch (stageNumber)
{
case 1:
sceneName = "Tutorial1test";
Expand All @@ -168,7 +174,7 @@ public void LoadScene(int stageNum)
sceneName = "Stage3test";
break;
default:
Debug.LogError($"Invalid stage number: {stageNum}");
Debug.LogError($"Invalid stage number: {stageNumber}");
return;
}
SceneManager.LoadScene(sceneName);
Expand Down
Loading

0 comments on commit 17a91c0

Please sign in to comment.