From 9d4c461d0717925e2b8ab00d28d57d044a6753d1 Mon Sep 17 00:00:00 2001 From: Nam Tae Gun Date: Sat, 30 Nov 2024 20:53:38 +0900 Subject: [PATCH] 0.3.5.0 --- Assets/01.Scenes/00.TycoonTitle.unity | 320 +----------- Assets/01.Scenes/01.Tycoon.unity | 20 +- Assets/02.Scripts/AspectRatioController.cs | 5 + Assets/02.Scripts/Character/Npc/Crew/Crew.cs | 2 +- .../Character/Player/Tycoon/TycoonPlayer.cs | 2 +- Assets/02.Scripts/CombatTitle.cs | 4 +- Assets/02.Scripts/PlayerInputKeyManager.cs | 62 +-- Assets/02.Scripts/Prop/Tycoon/Barrel.cs | 16 +- .../02.Scripts/Prop/Tycoon/GarnishBarrel.cs | 158 +++--- Assets/02.Scripts/Prop/Tycoon/LiquidBarrel.cs | 276 +++++++++-- Assets/02.Scripts/SceneController.cs | 104 ++-- Assets/02.Scripts/Tycoon/LiquidController.cs | 12 +- .../02.Scripts/Tycoon/TycoonCardController.cs | 1 + Assets/02.Scripts/Ui/PopupUiController.cs | 1 + Assets/02.Scripts/Ui/Title/TitleMenuButton.cs | 13 + Assets/02.Scripts/Ui/Title/TitleQuit.cs | 76 --- Assets/02.Scripts/Ui/Title/TitleQuitUi.cs | 94 ++++ ...{TitleQuit.cs.meta => TitleQuitUi.cs.meta} | 0 Assets/02.Scripts/Ui/Title/TycoonTitle.cs | 129 ++--- .../02.Scripts/Ui/Tycoon/TycoonResultCard.cs | 5 +- Assets/02.Scripts/Ui/Tycoon/TycoonResultUi.cs | 11 +- .../02.Scripts/Ui/UiNavigationController.cs | 56 +++ .../Ui/UiNavigationController.cs.meta | 2 + .../Props/Environment/Tycoons/Dirty01.png | Bin 125800 -> 97136 bytes .../Props/Environment/Tycoons/Dirty02.png | Bin 123576 -> 96389 bytes .../Props/Furniture/BartenderTableOff.png | Bin 54939 -> 52151 bytes .../Props/Furniture/BartenderTableOn.png | Bin 64625 -> 58073 bytes .../Props/Furniture/MoneyCounter01.png | Bin 149704 -> 146826 bytes .../Props/Furniture/MoneyCounter02.png | Bin 181128 -> 166784 bytes .../Props/Furniture/MoneyCounter03.png | Bin 224226 -> 188961 bytes .../Props/Furniture/MoneyCounterEmpty.png | Bin 73073 -> 125099 bytes Assets/03.Images/Props/Furniture/Mushroom.png | Bin 115078 -> 117891 bytes .../Props/Furniture/ServingTable02.png | Bin 53543 -> 50323 bytes Assets/03.Images/Props/Mini/Sign.png | Bin 5838 -> 31485 bytes Assets/03.Images/Props/Mini/Sign.png.meta | 2 +- Assets/03.Images/Props/Mini/Sign02.png | Bin 35908 -> 0 bytes .../03.Images/Ui/Balloon/CleaningBalloon.png | Bin 18942 -> 13450 bytes .../Ui/Balloon/CleaningTableBalloonFilled.png | Bin 31841 -> 29146 bytes .../Ui/Balloon/CleaningVomitBalloonFilled.png | Bin 31935 -> 26700 bytes Assets/03.Images/Ui/Balloon/HeartBalloon.png | Bin 0 -> 15868 bytes .../Balloon/HeartBalloon.png.meta} | 6 +- .../Ui/Balloon/HeartBalloonFilled.png | Bin 0 -> 27328 bytes .../Ui/Balloon/HeartBalloonFilled.png.meta | 143 ++++++ Assets/03.Images/Ui/Tycoon/Loading.meta | 8 + .../03.Images/Ui/Tycoon/Loading/LineBlue.png | Bin 0 -> 27511 bytes .../Ui/Tycoon/Loading/LineBlue.png.meta | 166 +++++++ .../03.Images/Ui/Tycoon/Loading/Loading01.png | Bin 0 -> 10985 bytes .../Ui/Tycoon/Loading/Loading01.png.meta | 166 +++++++ .../03.Images/Ui/Tycoon/Loading/Loading02.png | Bin 0 -> 11700 bytes .../Ui/Tycoon/Loading/Loading02.png.meta | 166 +++++++ .../03.Images/Ui/Tycoon/Loading/Loading03.png | Bin 0 -> 11753 bytes .../Ui/Tycoon/Loading/Loading03.png.meta | 166 +++++++ .../03.Images/Ui/Tycoon/Loading/Loading04.png | Bin 0 -> 11695 bytes .../Ui/Tycoon/Loading/Loading04.png.meta | 166 +++++++ .../Ui/Tycoon/Loading/LoadingBackGround.png | Bin 0 -> 1954583 bytes .../Tycoon/Loading/LoadingBackGround.png.meta | 143 ++++++ .../Managers/SceneController.prefab | 454 +++++++++++++++++- .../Maps/Tycoon/NewTycoonMap.prefab | 28 ++ .../Interactions/BartenderTable02.prefab | 2 +- .../Interactions/LiquidBarrel.prefab | 8 +- .../Furniture/Interactions/Mushroom.prefab | 28 +- .../Interactions/ServingTable02.prefab | 2 +- .../05.Prefabs/Uis/Tycoons/ResultCard.prefab | 36 +- .../Uis/Tycoons/TycoonGameMenuCanvas.prefab | 70 +-- .../Uis/Tycoons/TycoonTitleMenuCanvas.prefab | 53 +- Assets/07.Animations/Uis/Loading.anim | 84 ++++ Assets/07.Animations/Uis/Loading.anim.meta | 8 + Assets/07.Animations/Uis/Loading.controller | 72 +++ .../07.Animations/Uis/Loading.controller.meta | 8 + .../Players/Tycoons/MainCharacter.skel.bytes | Bin 58332 -> 60561 bytes .../08.Spines/Props/Barrel/Barrel.atlas.txt | 27 +- Assets/08.Spines/Props/Barrel/Barrel.png | Bin 533203 -> 836091 bytes .../08.Spines/Props/Barrel/Barrel.skel.bytes | Bin 2472 -> 10845 bytes .../Props/LimeTreeGarnish/LimeTree.atlas.txt | 16 +- .../Props/LimeTreeGarnish/LimeTree.png | Bin 593459 -> 446938 bytes .../Props/LimeTreeGarnish/LimeTree.skel.bytes | Bin 27035 -> 27035 bytes .../Props/SlimeGarnish/Slime.atlas.txt | 12 +- Assets/08.Spines/Props/SlimeGarnish/Slime.png | Bin 238342 -> 177961 bytes .../Props/SlimeGarnish/Slime.skel.bytes | Bin 20065 -> 20065 bytes .../Props/TrashCan/Trashcan.atlas.txt | 24 +- Assets/08.Spines/Props/TrashCan/Trashcan.png | Bin 526413 -> 657708 bytes .../Props/TrashCan/Trashcan.skel.bytes | Bin 7762 -> 7762 bytes Assets/AddressableAssetsData/link.xml | 24 + Assets/AddressableAssetsData/link.xml.meta | 7 + ProjectSettings/ProjectSettings.asset | 2 +- 85 files changed, 2671 insertions(+), 795 deletions(-) delete mode 100644 Assets/02.Scripts/Ui/Title/TitleQuit.cs create mode 100644 Assets/02.Scripts/Ui/Title/TitleQuitUi.cs rename Assets/02.Scripts/Ui/Title/{TitleQuit.cs.meta => TitleQuitUi.cs.meta} (100%) create mode 100644 Assets/02.Scripts/Ui/UiNavigationController.cs create mode 100644 Assets/02.Scripts/Ui/UiNavigationController.cs.meta delete mode 100644 Assets/03.Images/Props/Mini/Sign02.png create mode 100644 Assets/03.Images/Ui/Balloon/HeartBalloon.png rename Assets/03.Images/{Props/Mini/Sign02.png.meta => Ui/Balloon/HeartBalloon.png.meta} (97%) create mode 100644 Assets/03.Images/Ui/Balloon/HeartBalloonFilled.png create mode 100644 Assets/03.Images/Ui/Balloon/HeartBalloonFilled.png.meta create mode 100644 Assets/03.Images/Ui/Tycoon/Loading.meta create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/LineBlue.png create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/LineBlue.png.meta create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/Loading01.png create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/Loading01.png.meta create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/Loading02.png create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/Loading02.png.meta create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/Loading03.png create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/Loading03.png.meta create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/Loading04.png create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/Loading04.png.meta create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/LoadingBackGround.png create mode 100644 Assets/03.Images/Ui/Tycoon/Loading/LoadingBackGround.png.meta create mode 100644 Assets/07.Animations/Uis/Loading.anim create mode 100644 Assets/07.Animations/Uis/Loading.anim.meta create mode 100644 Assets/07.Animations/Uis/Loading.controller create mode 100644 Assets/07.Animations/Uis/Loading.controller.meta create mode 100644 Assets/AddressableAssetsData/link.xml create mode 100644 Assets/AddressableAssetsData/link.xml.meta diff --git a/Assets/01.Scenes/00.TycoonTitle.unity b/Assets/01.Scenes/00.TycoonTitle.unity index 2dceac4f5..853dbe8c3 100644 --- a/Assets/01.Scenes/00.TycoonTitle.unity +++ b/Assets/01.Scenes/00.TycoonTitle.unity @@ -137,6 +137,7 @@ GameObject: - component: {fileID: 191889759} - component: {fileID: 191889758} - component: {fileID: 191889757} + - component: {fileID: 191889763} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -302,6 +303,20 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 19.824, y: 0, z: 0} +--- !u!114 &191889763 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 191889754} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dec61aec08a92c54282e06819b88a31c, type: 3} + m_Name: + m_EditorClassIdentifier: + _canvasRectTransforms: + - {fileID: 8401317452346303362} --- !u!1001 &225733419 PrefabInstance: m_ObjectHideFlags: 0 @@ -480,44 +495,6 @@ Light: m_LightUnit: 1 m_LuxAtDistance: 1 m_EnableSpotReflector: 1 ---- !u!1 &555448121 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 555448122} - m_Layer: 5 - m_Name: TitleEmpty - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &555448122 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 555448121} - m_LocalRotation: {x: 0.3420201, y: -0, z: -0, w: 0.9396927} - m_LocalPosition: {x: 0, y: 0, z: -12.330473} - m_LocalScale: {x: 0.0053499998, y: 0.0053499998, z: 0.0053499998} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 1126145270} - - {fileID: 623912210} - - {fileID: 1472887923} - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0.5, y: 4.974551} - m_SizeDelta: {x: 1921.3599, y: 1080} - m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &582179848 GameObject: m_ObjectHideFlags: 1 @@ -567,96 +544,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &623912209 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 623912210} - - component: {fileID: 623912213} - - component: {fileID: 623912212} - - component: {fileID: 623912211} - m_Layer: 5 - m_Name: Character - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &623912210 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 623912209} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 555448122} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 450, y: 0} - m_SizeDelta: {x: 1100, y: 1100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &623912211 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 623912209} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 101a55adb2ae5424a8c6d0efbc862503, type: 3} - m_Name: - m_EditorClassIdentifier: - parentRectTransform: {fileID: 555448122} - smoothSpeed: 5 ---- !u!114 &623912212 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 623912209} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: caee1616acbdbb9488a107b0894e9d0d, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &623912213 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 623912209} - m_CullTransparentMesh: 1 --- !u!1 &652021011 GameObject: m_ObjectHideFlags: 0 @@ -763,81 +650,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 1614514235215fe4b877ab0945881d27, type: 3} ---- !u!1 &1126145269 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1126145270} - - component: {fileID: 1126145272} - - component: {fileID: 1126145271} - m_Layer: 5 - m_Name: Background - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1126145270 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1126145269} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 555448122} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1126145271 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1126145269} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: db3faf3bbc689a045b900709a21b024d, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &1126145272 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1126145269} - m_CullTransparentMesh: 1 --- !u!1 &1196361497 GameObject: m_ObjectHideFlags: 0 @@ -973,96 +785,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: e4f3702d2bd51af41ac161d64cfc9ba5, type: 3} ---- !u!1 &1472887922 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1472887923} - - component: {fileID: 1472887926} - - component: {fileID: 1472887925} - - component: {fileID: 1472887924} - m_Layer: 5 - m_Name: Table - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1472887923 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1472887922} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 555448122} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0} - m_AnchorMax: {x: 0.5, y: 0} - m_AnchoredPosition: {x: -5, y: 0} - m_SizeDelta: {x: 2400, y: 500} - m_Pivot: {x: 0.5, y: 0} ---- !u!114 &1472887924 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1472887922} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4a810d0a847a60841803b0aed975f42c, type: 3} - m_Name: - m_EditorClassIdentifier: - parentRectTransform: {fileID: 555448122} - smoothSpeed: 5 ---- !u!114 &1472887925 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1472887922} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 542969911f9d133438e8db6b05d4ee15, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &1472887926 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1472887922} - m_CullTransparentMesh: 1 --- !u!1001 &1532114149 PrefabInstance: m_ObjectHideFlags: 0 @@ -1335,7 +1057,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3809829019576091026, guid: fbbace4abceeb19418e16840f571e2bd, type: 3} propertyPath: m_AnchoredPosition.y - value: -320 + value: -350 objectReference: {fileID: 0} - target: {fileID: 3949558785420068140, guid: fbbace4abceeb19418e16840f571e2bd, type: 3} propertyPath: m_IsActive @@ -1435,7 +1157,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5532522907040737260, guid: fbbace4abceeb19418e16840f571e2bd, type: 3} propertyPath: m_AnchoredPosition.y - value: -200 + value: -230 objectReference: {fileID: 0} - target: {fileID: 5833474583663148126, guid: fbbace4abceeb19418e16840f571e2bd, type: 3} propertyPath: m_AnchorMax.y @@ -1771,7 +1493,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8810811118502247075, guid: fbbace4abceeb19418e16840f571e2bd, type: 3} propertyPath: m_AnchoredPosition.y - value: -80 + value: -110 objectReference: {fileID: 0} - target: {fileID: 8855145811590553786, guid: fbbace4abceeb19418e16840f571e2bd, type: 3} propertyPath: m_AnchorMax.y @@ -1806,6 +1528,11 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: fbbace4abceeb19418e16840f571e2bd, type: 3} +--- !u!224 &8401317452346303362 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 7869185857112310372, guid: fbbace4abceeb19418e16840f571e2bd, type: 3} + m_PrefabInstance: {fileID: 8401317452346303361} + m_PrefabAsset: {fileID: 0} --- !u!1001 &8887082685865409626 PrefabInstance: m_ObjectHideFlags: 0 @@ -1879,4 +1606,3 @@ SceneRoots: - {fileID: 8401317452346303361} - {fileID: 582179850} - {fileID: 8887082685865409626} - - {fileID: 555448122} diff --git a/Assets/01.Scenes/01.Tycoon.unity b/Assets/01.Scenes/01.Tycoon.unity index 99d8763d2..e7a212dcd 100644 --- a/Assets/01.Scenes/01.Tycoon.unity +++ b/Assets/01.Scenes/01.Tycoon.unity @@ -1912,6 +1912,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 128638924} + - component: {fileID: 128638925} m_Layer: 5 m_Name: Bills m_TagString: Untagged @@ -1938,6 +1939,20 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &128638925 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 128638923} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3312d7739989d2b4e91e6319e9a96d76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: {x: 0, y: 0, z: 0, w: 0} + m_Softness: {x: 0, y: 0} --- !u!1 &130732687 GameObject: m_ObjectHideFlags: 0 @@ -5001,7 +5016,7 @@ MonoBehaviour: m_EditorClassIdentifier: _goldAnimator: {fileID: 1308258170} _goldText: {fileID: 677143483} - _animationTime: 1 + _animationTime: 0.3 --- !u!114 &437358695 MonoBehaviour: m_ObjectHideFlags: 0 @@ -18258,7 +18273,7 @@ MonoBehaviour: _panel: {fileID: 1054626872} _contents: {fileID: 2028799953} _cardLocalScale: {x: 0.65, y: 0.65, z: 1} - _endGoldChangeDuration: 0.5 + _endGoldChangeDuration: 0.3 _soldOutSfxName: SoldOut _targetColor: {r: 1, g: 0, b: 0, a: 1} _duration: 0.3 @@ -21529,7 +21544,6 @@ MonoBehaviour: _serverTipMultiplier: 0 _cleanerCleaningReduction: 0 _bartenderMakingReduction: 0 - _currentPassiveCard: 0 k__BackingField: {fileID: 11400000, guid: 702b1ed0ce71d1b4aa1ddbce67e475a1, type: 2} --- !u!114 &1665075870 MonoBehaviour: diff --git a/Assets/02.Scripts/AspectRatioController.cs b/Assets/02.Scripts/AspectRatioController.cs index c74c5631e..37841ad80 100644 --- a/Assets/02.Scripts/AspectRatioController.cs +++ b/Assets/02.Scripts/AspectRatioController.cs @@ -20,6 +20,11 @@ namespace BlueWater EventManager.OnChangedDisplay += ChangeResolution; } + private void Start() + { + _canvasRectTransforms.Add(SceneController.Instance.Panel.GetComponent()); + } + private void OnDestroy() { EventManager.OnChangedDisplay -= ChangeResolution; diff --git a/Assets/02.Scripts/Character/Npc/Crew/Crew.cs b/Assets/02.Scripts/Character/Npc/Crew/Crew.cs index 903496225..c2443cf4b 100644 --- a/Assets/02.Scripts/Character/Npc/Crew/Crew.cs +++ b/Assets/02.Scripts/Character/Npc/Crew/Crew.cs @@ -180,7 +180,7 @@ namespace BlueWater.Npcs.Crews public virtual bool CanInteractionPosition() { - if (CrewInteraction.CenterTransform == null) return false; + if (CrewInteraction == null || CrewInteraction.CenterTransform == null) return false; return AIMovement.HasReachedDestination() || Vector3.Distance(CrewInteraction.CenterTransform.position, transform.position) <= diff --git a/Assets/02.Scripts/Character/Player/Tycoon/TycoonPlayer.cs b/Assets/02.Scripts/Character/Player/Tycoon/TycoonPlayer.cs index d1ecd40ab..d6fc067b2 100644 --- a/Assets/02.Scripts/Character/Player/Tycoon/TycoonPlayer.cs +++ b/Assets/02.Scripts/Character/Player/Tycoon/TycoonPlayer.cs @@ -171,7 +171,7 @@ namespace BlueWater.Players.Tycoons private void Die() { - var saveGold = (int)(TycoonManager.Instance.TycoonStatus.CurrentGold * TycoonManager.Instance.TycoonStatus.EndGoldMultiplier); + int saveGold = Mathf.RoundToInt(TycoonManager.Instance.TycoonStatus.CurrentGold * TycoonManager.Instance.TycoonStatus.EndGoldMultiplier); ES3.Save(SaveData.EndGold, saveGold); } diff --git a/Assets/02.Scripts/CombatTitle.cs b/Assets/02.Scripts/CombatTitle.cs index 15f87384a..5ab312e6c 100644 --- a/Assets/02.Scripts/CombatTitle.cs +++ b/Assets/02.Scripts/CombatTitle.cs @@ -33,7 +33,7 @@ namespace BlueWater.Titles private void Start() { AudioManager.Instance.PlayBgm(_dailyBgm); - _startGameButton.onClick.AddListener(SceneController.Instance.FadeIn); + _startGameButton.onClick.AddListener(() => SceneController.Instance.LoadScene(SceneName.Combat)); } private void OnApplicationQuit() @@ -45,7 +45,7 @@ namespace BlueWater.Titles { if (_isQuitting) return; - _startGameButton.onClick.RemoveListener(SceneController.Instance.FadeIn); + _startGameButton.onClick.RemoveListener(() => SceneController.Instance.LoadScene(SceneName.Combat)); } [Button("컴포넌트 초기화")] diff --git a/Assets/02.Scripts/PlayerInputKeyManager.cs b/Assets/02.Scripts/PlayerInputKeyManager.cs index 6f309a052..5f92adcc9 100644 --- a/Assets/02.Scripts/PlayerInputKeyManager.cs +++ b/Assets/02.Scripts/PlayerInputKeyManager.cs @@ -10,11 +10,17 @@ namespace BlueWater public enum InputActionMaps { None = 0, - Tycoon, - TycoonUi, - CombatTitle, - Combat, - CombatUi, + UI = 1, + Tycoon = 2, + TycoonUi = 3, + CombatTitle = 4, + Combat = 5, + CombatUi = 6 + } + + public static class UiActions + { + public const string Navigate = "Navigate"; } public static class TycoonActions @@ -62,29 +68,29 @@ namespace BlueWater SceneManager.sceneLoaded += OnSceneLoaded; } - public void Update() - { - bool CheckMouse(){return Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)||Input.GetMouseButtonDown(2);} - - if(!_isKey && Input.anyKeyDown && !CheckMouse()) //키보드 감지 (최초) - { - foreach (var element in _onActionKeyboard) - { - element?.Invoke(); - } - _lastMousePosition = Input.mousePosition; - _isKey = true; - } - else if (_isKey && (Input.anyKeyDown && CheckMouse() || (_isKey && Input.mousePosition != _lastMousePosition))) //마우스 감지 (최초) - { - foreach (var element in _onActionMouse) - { - element?.Invoke(); - } - _lastMousePosition = Input.mousePosition; - _isKey = false; - } - } + // public void Update() + // { + // bool CheckMouse(){return Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)||Input.GetMouseButtonDown(2);} + // + // if(!_isKey && Input.anyKeyDown && !CheckMouse()) //키보드 감지 (최초) + // { + // foreach (var element in _onActionKeyboard) + // { + // element?.Invoke(); + // } + // _lastMousePosition = Input.mousePosition; + // _isKey = true; + // } + // else if (_isKey && (Input.anyKeyDown && CheckMouse() || (_isKey && Input.mousePosition != _lastMousePosition))) //마우스 감지 (최초) + // { + // foreach (var element in _onActionMouse) + // { + // element?.Invoke(); + // } + // _lastMousePosition = Input.mousePosition; + // _isKey = false; + // } + // } private async void OnSceneLoaded(Scene scene, LoadSceneMode mode) { diff --git a/Assets/02.Scripts/Prop/Tycoon/Barrel.cs b/Assets/02.Scripts/Prop/Tycoon/Barrel.cs index 624c51494..9d7604c71 100644 --- a/Assets/02.Scripts/Prop/Tycoon/Barrel.cs +++ b/Assets/02.Scripts/Prop/Tycoon/Barrel.cs @@ -17,7 +17,7 @@ namespace BlueWater.Tycoons protected LiquidData LiquidData; [SerializeField] - protected float VisualMaxFill = 4000f; + protected int VisualMaxFill = 4000; [field: SerializeField] public int CurrentAmount { get; private set; } @@ -42,8 +42,11 @@ namespace BlueWater.Tycoons SpineController = GetComponent(); LiquidData = ItemManager.Instance.LiquidDataSo.GetDataByIdx(Idx); - - EventManager.OnAddBarrels += AddCurrentAmount; + + if (!IsStatue) + { + EventManager.OnAddBarrels += AddCurrentAmount; + } EventManager.OnAutoSupplyBarrels += AutoSupply; } @@ -56,7 +59,10 @@ namespace BlueWater.Tycoons private void OnDestroy() { - EventManager.OnAddBarrels -= AddCurrentAmount; + if (!IsStatue) + { + EventManager.OnAddBarrels -= AddCurrentAmount; + } EventManager.OnAutoSupplyBarrels -= AutoSupply; } @@ -67,7 +73,7 @@ namespace BlueWater.Tycoons public bool CanConsume(int amount) { - return CurrentAmount - amount > 0; + return CurrentAmount > 0 && CurrentAmount - amount >= 0; } public virtual void Consume(int amount) diff --git a/Assets/02.Scripts/Prop/Tycoon/GarnishBarrel.cs b/Assets/02.Scripts/Prop/Tycoon/GarnishBarrel.cs index 9cb6cb8fc..7835a0b72 100644 --- a/Assets/02.Scripts/Prop/Tycoon/GarnishBarrel.cs +++ b/Assets/02.Scripts/Prop/Tycoon/GarnishBarrel.cs @@ -1,3 +1,4 @@ + using System; using BlueWater.Utility; using UnityEngine; @@ -17,9 +18,19 @@ namespace BlueWater.Tycoons public const string UnFillToLevel2 = "Change50to10"; public const string UnFillToLevel3 = "Change100to50"; } + + public enum GarnishType + { + None = 0, + Slime = 1, + LimeTree = 2 + } public class GarnishBarrel : Barrel { + [SerializeField] + private GarnishType _garnishType; + private int _currentLevel; protected override void Start() @@ -47,11 +58,11 @@ namespace BlueWater.Tycoons { OnBarrelInteracted?.Invoke(this); - if (LiquidData.Idx == "Garnish1") + if (_garnishType == GarnishType.Slime) { GameManager.Instance.CurrentTycoonPlayer.IsInteractedSlimeGarnish = true; } - else if (LiquidData.Idx == "Garnish2") + else if (_garnishType == GarnishType.LimeTree) { GameManager.Instance.CurrentTycoonPlayer.IsInteractedLimeTreeGarnish = true; } @@ -61,11 +72,11 @@ namespace BlueWater.Tycoons { OnBarrelCancelInteracted?.Invoke(); - if (LiquidData.Idx == "Garnish1") + if (_garnishType == GarnishType.Slime) { GameManager.Instance.CurrentTycoonPlayer.IsInteractedSlimeGarnish = false; } - else if (LiquidData.Idx == "Garnish2") + else if (_garnishType == GarnishType.LimeTree) { GameManager.Instance.CurrentTycoonPlayer.IsInteractedLimeTreeGarnish = false; } @@ -114,17 +125,21 @@ namespace BlueWater.Tycoons { base.Activate(); - FillAnimation(); + _currentLevel = GetCurrentLevel(); + IdleAnimation(); } public override void Consume(int amount) { + if (!IsActivated) return; + base.Consume(amount); var newLevel = GetCurrentLevel(); if (_currentLevel != newLevel) { - UnfillAnimation(); + UnfillAnimation(newLevel); + _currentLevel = newLevel; } } @@ -137,81 +152,80 @@ namespace BlueWater.Tycoons var newLevel = GetCurrentLevel(); if (_currentLevel != newLevel) { - FillAnimation(); - } - } - - private int GetCurrentLevel() - { - int max = (int)VisualMaxFill; - if (CurrentAmount >= max) - { - return 4; - } - if (CurrentAmount >= max / 2) - { - return 3; - } - if (CurrentAmount > 0) - { - return 2; - } - return 1; - } - - private void FillAnimation() - { - int max = (int)VisualMaxFill; - if (CurrentAmount >= max) - { - SpineController.PlayAnimation(GarnishBarrelSpineAnimation.FillToLevel4, false); - SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel4, true); - _currentLevel = 4; - } - else if (CurrentAmount >= max / 2) - { - SpineController.PlayAnimation(GarnishBarrelSpineAnimation.FillToLevel3, false); - SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel3, true); - _currentLevel = 3; - } - else if (CurrentAmount > 0) - { - SpineController.PlayAnimation(GarnishBarrelSpineAnimation.FillToLevel2, false); - SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel2, true); - _currentLevel = 2; - } - else - { - SpineController.PlayAnimation(GarnishBarrelSpineAnimation.IdleLevel1, true); - _currentLevel = 1; + FillAnimation(newLevel); + _currentLevel = newLevel; } } - private void UnfillAnimation() + private int GetCurrentLevel() { - int max = (int)VisualMaxFill; - if (CurrentAmount >= max) + if (CurrentAmount <= 0) return 0; + if (CurrentAmount >= VisualMaxFill) return 4; + + float range = VisualMaxFill / 3f; + return (int)(CurrentAmount / range) + 1; + } + + private void IdleAnimation() + { + switch (_currentLevel) { - SpineController.PlayAnimation(GarnishBarrelSpineAnimation.IdleLevel4, true); - _currentLevel = 4; + case 0: + SpineController.PlayAnimation(GarnishBarrelSpineAnimation.IdleLevel1, false); + break; + case 1: + SpineController.PlayAnimation(GarnishBarrelSpineAnimation.IdleLevel2, false); + break; + case 2: + SpineController.PlayAnimation(GarnishBarrelSpineAnimation.IdleLevel3, false); + break; + case 3: + SpineController.PlayAnimation(GarnishBarrelSpineAnimation.IdleLevel4, false); + break; + default: + throw new Exception("_currentLevel 존재하지 않는 값"); } - else if (CurrentAmount >= max / 2) + } + + private void FillAnimation(int newLevel) + { + switch (newLevel) { - SpineController.PlayAnimation(GarnishBarrelSpineAnimation.UnFillToLevel3, false); - SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel3, true); - _currentLevel = 3; + case 2: + SpineController.PlayAnimation(GarnishBarrelSpineAnimation.FillToLevel2, false); + SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel2, true); + break; + case 3: + SpineController.PlayAnimation(GarnishBarrelSpineAnimation.FillToLevel3, false); + SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel3, true); + break; + case 4: + SpineController.PlayAnimation(GarnishBarrelSpineAnimation.FillToLevel4, false); + SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel4, true); + break; + default: + throw new Exception("_currentLevel 존재하지 않는 값"); } - else if (CurrentAmount > 0) + } + + private void UnfillAnimation(int newLevel) + { + switch (newLevel) { - SpineController.PlayAnimation(GarnishBarrelSpineAnimation.UnFillToLevel2, false); - SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel2, true); - _currentLevel = 2; - } - else - { - SpineController.PlayAnimation(GarnishBarrelSpineAnimation.UnFillToLevel1, false); - SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel1, true); - _currentLevel = 1; + case 1: + SpineController.PlayAnimation(GarnishBarrelSpineAnimation.UnFillToLevel1, false); + SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel1, true); + break; + case 2: + SpineController.PlayAnimation(GarnishBarrelSpineAnimation.UnFillToLevel2, false); + SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel2, true); + break; + case 3: + SpineController.PlayAnimation(GarnishBarrelSpineAnimation.UnFillToLevel3, false); + SpineController.AddAnimation(GarnishBarrelSpineAnimation.IdleLevel3, true); + break; + default: + throw new Exception("_currentLevel 존재하지 않는 값"); } } } diff --git a/Assets/02.Scripts/Prop/Tycoon/LiquidBarrel.cs b/Assets/02.Scripts/Prop/Tycoon/LiquidBarrel.cs index 16e25f3ca..4d89fd914 100644 --- a/Assets/02.Scripts/Prop/Tycoon/LiquidBarrel.cs +++ b/Assets/02.Scripts/Prop/Tycoon/LiquidBarrel.cs @@ -1,3 +1,4 @@ +using System; using BlueWater.Utility; using Sirenix.OdinInspector; using UnityEngine; @@ -6,22 +7,47 @@ namespace BlueWater.Tycoons { public static class LiquidBarrelSpineAnimation { - public const string Idle = "IdleNormal"; - public const string Mold = "IdleDirty"; - public const string ChangeIdle = "ChangeClean"; - public const string ChangeMold = "ChangeDirty"; + public const string IdleLevel0 = "Empty"; + public const string IdleLevel1 = "Idle1"; + public const string IdleLevel2 = "Idle2"; + public const string IdleLevel3 = "Idle3"; + public const string IdleLevel4 = "Idle4"; + public const string IdleLevel5 = "Idle5"; + public const string MoldIdle = "IdleDirty"; + public const string ChangeCleanLevel0 = "ChangeClean0"; + public const string ChangeCleanLevel1 = "ChangeClean1"; + public const string ChangeCleanLevel2 = "ChangeClean2"; + public const string ChangeCleanLevel3 = "ChangeClean3"; + public const string ChangeCleanLevel4 = "ChangeClean4"; + public const string ChangeCleanLevel5 = "ChangeClean5"; + public const string ChangeMoldLevel0 = "ChangeDirty0"; + public const string ChangeMoldLevel1 = "ChangeDirty1"; + public const string ChangeMoldLevel2 = "ChangeDirty2"; + public const string ChangeMoldLevel3 = "ChangeDirty3"; + public const string ChangeMoldLevel4 = "ChangeDirty4"; + public const string ChangeMoldLevel5 = "ChangeDirty5"; + public const string FillLevel1 = "FillBeer0to1"; + public const string FillLevel2 = "FillBeer1to2"; + public const string FillLevel3 = "FillBeer2to3"; + public const string FillLevel4 = "FillBeer3to4"; + public const string FillLevel5 = "FillBeer4to5"; + public const string UnfillLevel0 = "EmptyBeer1to0"; + public const string UnfillLevel1 = "EmptyBeer2to1"; + public const string UnfillLevel2 = "EmptyBeer3to2"; + public const string UnfillLevel3 = "EmptyBeer4to3"; + public const string UnfillLevel4 = "EmptyBeer5to4"; + public const string InteractionLevel0 = "ServingBeer0"; + public const string InteractionLevel1 = "ServingBeer1"; + public const string InteractionLevel2 = "ServingBeer2"; + public const string InteractionLevel3 = "ServingBeer3"; + public const string InteractionLevel4 = "ServingBeer4"; + public const string InteractionLevel5 = "ServingBeer5"; } public class LiquidBarrel : Barrel { [SerializeField, Required] private SpriteRenderer _liquidImage; - - [SerializeField, Required] - private SpriteRenderer _fill; - - [SerializeField, Range(1f, 5f), Tooltip("목표 색상 * 밝기")] - private float _colorIntensity = 2f; [field: SerializeField] public bool IsMoldy { get; private set; } @@ -29,31 +55,18 @@ namespace BlueWater.Tycoons [SerializeField] private float _playerHoldingTime = 3f; - private Material _instanceMaterial; private bool _isPlayerInteracting; - - // Hashes - private static readonly int LiquidAmountHash = Shader.PropertyToID("_LiquidAmount"); - private static readonly int LiquidColorHash = Shader.PropertyToID("_LiquidColor"); - - protected override void Awake() - { - base.Awake(); - - _instanceMaterial = Instantiate(_fill.material); - _fill.material = _instanceMaterial; - } + private int _currentLevel; protected override void Start() { base.Start(); _liquidImage.sprite = IsActivated ? LiquidData.Sprite : DataManager.Instance.SpriteDataSo.BarrelLock; - _instanceMaterial.SetColor(LiquidColorHash, LiquidData.Color * _colorIntensity); if (!IsStatue) { - SpineController.PlayAnimation(LiquidBarrelSpineAnimation.Idle, false); + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.IdleLevel0, false); } } @@ -182,9 +195,6 @@ namespace BlueWater.Tycoons } base.SetCurrentAmount(amount); - - var liquidAmount = CurrentAmount / VisualMaxFill; - _instanceMaterial.SetFloat(LiquidAmountHash, liquidAmount); } public override void Activate() @@ -192,6 +202,39 @@ namespace BlueWater.Tycoons base.Activate(); _liquidImage.sprite = IsActivated ? LiquidData.Sprite : DataManager.Instance.SpriteDataSo.BarrelLock; + + if (IsStatue) return; + + _currentLevel = GetCurrentLevel(); + IdleAnimation(); + } + + public override void Consume(int amount) + { + if (!IsActivated || IsMoldy) return; + + base.Consume(amount); + + int newLevel = GetCurrentLevel(); + if (_currentLevel != newLevel) + { + UnfillAnimation(newLevel); + _currentLevel = newLevel; + } + } + + public override void AddCurrentAmount(int addedValue) + { + if (!IsActivated) return; + + base.AddCurrentAmount(addedValue); + + int newLevel = GetCurrentLevel(); + if (_currentLevel != newLevel) + { + FillAnimation(newLevel); + _currentLevel = newLevel; + } } public override bool CanMakingCocktailCrew(int amount) @@ -207,16 +250,185 @@ namespace BlueWater.Tycoons public override void Mold() { IsMoldy = true; - SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeMold, false); - SpineController.AddAnimation(LiquidBarrelSpineAnimation.Mold, true); + MoldAnimation(); } public void Recovery() { CancelInteraction(); IsMoldy = false; - SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeIdle, false); - SpineController.AddAnimation(LiquidBarrelSpineAnimation.Idle, false); + RecoveryAnimation(); + } + + private int GetCurrentLevel() + { + if (CurrentAmount <= 0) return 0; + if (CurrentAmount >= VisualMaxFill) return 5; + + int range = VisualMaxFill / 5; + return CurrentAmount / range + 1; + } + + private void IdleAnimation() + { + switch (_currentLevel) + { + case 0: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.IdleLevel0, false); + break; + case 1: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.IdleLevel1, false); + break; + case 2: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.IdleLevel2, false); + break; + case 3: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.IdleLevel3, false); + break; + case 4: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.IdleLevel4, false); + break; + case 5: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.IdleLevel5, false); + break; + default: + throw new Exception("_currentLevel 존재하지 않는 값"); + } + } + + private void FillAnimation(int newLevel) + { + if (IsMoldy) return; + + switch (newLevel) + { + case 1: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.FillLevel1, false); + break; + case 2: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.FillLevel2, false); + break; + case 3: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.FillLevel3, false); + break; + case 4: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.FillLevel4, false); + break; + case 5: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.FillLevel5, false); + break; + default: + throw new Exception("_currentLevel 존재하지 않는 값"); + } + } + + private void UnfillAnimation(int newLevel) + { + if (IsMoldy) return; + + switch (newLevel) + { + case 0: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.UnfillLevel0, false); + break; + case 1: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.UnfillLevel1, false); + break; + case 2: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.UnfillLevel2, false); + break; + case 3: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.UnfillLevel3, false); + break; + case 4: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.UnfillLevel4, false); + break; + default: + throw new Exception("_currentLevel 존재하지 않는 값"); + } + } + + private void MoldAnimation() + { + switch (_currentLevel) + { + case 0: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeMoldLevel0, false); + break; + case 1: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeMoldLevel1, false); + break; + case 2: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeMoldLevel2, false); + break; + case 3: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeMoldLevel3, false); + break; + case 4: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeMoldLevel4, false); + break; + case 5: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeMoldLevel5, false); + break; + default: + throw new Exception("_currentLevel 존재하지 않는 값"); + } + + SpineController.AddAnimation(LiquidBarrelSpineAnimation.MoldIdle, true); + } + + private void RecoveryAnimation() + { + switch (_currentLevel) + { + case 0: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeCleanLevel0, false); + break; + case 1: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeCleanLevel1, false); + break; + case 2: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeCleanLevel2, false); + break; + case 3: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeCleanLevel3, false); + break; + case 4: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeCleanLevel4, false); + break; + case 5: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.ChangeCleanLevel5, false); + break; + default: + throw new Exception("_currentLevel 존재하지 않는 값"); + } + } + + private void InteractionAnimation() + { + switch (_currentLevel) + { + case 0: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.InteractionLevel0, false, trackIndex:1); + break; + case 1: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.InteractionLevel1, false, trackIndex:1); + break; + case 2: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.InteractionLevel2, false, trackIndex:1); + break; + case 3: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.InteractionLevel3, false, trackIndex:1); + break; + case 4: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.InteractionLevel4, false, trackIndex:1); + break; + case 5: + SpineController.PlayAnimation(LiquidBarrelSpineAnimation.InteractionLevel5, false, trackIndex:1); + break; + default: + throw new Exception("_currentLevel 존재하지 않는 값"); + } } } } \ No newline at end of file diff --git a/Assets/02.Scripts/SceneController.cs b/Assets/02.Scripts/SceneController.cs index 3a56b2610..9d3343c59 100644 --- a/Assets/02.Scripts/SceneController.cs +++ b/Assets/02.Scripts/SceneController.cs @@ -1,4 +1,6 @@ +using System.Threading.Tasks; using DG.Tweening; +using Sirenix.OdinInspector; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; @@ -15,78 +17,90 @@ namespace BlueWater public class SceneController : Singleton { + [field: SerializeField] + public GameObject Panel { get; private set; } + [SerializeField] private Image _fadeImage; + + [SerializeField] + private CanvasGroup _loadingPanelCanvasGroup; + + [Title("연출")] + [SerializeField] + private float _fadeInTime = 0.5f; + + [SerializeField] + private float _fadeOutTime = 0.5f; + + [SerializeField] + private float _loadingWaitTime = 2f; private Tween _fadeIn; private Tween _fadeOut; - - private bool _isMovedCombatScene; + private Tween _loadingPanelFadeIn; + private Tween _loadingPanelFadeOut; protected override void OnAwake() { - _fadeIn = _fadeImage.DOFade(1f, 1f).From(0f).SetUpdate(true).SetAutoKill(false).Pause().OnComplete(MoveCombatScene); - _fadeOut = _fadeImage.DOFade(0f, 0.5f).From(1f).SetUpdate(true).SetAutoKill(false).Pause().SetDelay(3f); + _fadeIn = _fadeImage.DOFade(1f, _fadeInTime).From(0f).SetUpdate(true).SetAutoKill(false).Pause(); + _fadeOut = _fadeImage.DOFade(0f, _fadeOutTime).From(1f).SetUpdate(true).SetAutoKill(false).Pause(); + _loadingPanelFadeIn = _loadingPanelCanvasGroup.DOFade(1f, _fadeInTime).From(0f).SetUpdate(true).SetAutoKill(false).Pause(); + _loadingPanelFadeOut = _loadingPanelCanvasGroup.DOFade(0f, _fadeOutTime).From(1f).SetUpdate(true).SetAutoKill(false).Pause(); _fadeImage.color = new Color(0, 0, 0, 0); - } - - private void Start() - { - SceneManager.sceneLoaded += OnSceneLoaded; + _loadingPanelCanvasGroup.alpha = 0f; } private void OnDestroy() { if (Quitting) return; - - SceneManager.sceneLoaded -= OnSceneLoaded; - _fadeIn.Kill(); - _fadeOut.Kill(); - } - - public void FadeIn() - { - _fadeIn.Restart(); + _fadeIn?.Kill(); + _fadeOut?.Kill(); + _loadingPanelFadeIn?.Kill(); + _loadingPanelFadeOut?.Kill(); } public void RestartCurrentScene() { - VisualFeedbackManager.Instance.ResetTimeScale(); - string currentSceneName = SceneManager.GetActiveScene().name; - SceneManager.LoadScene(currentSceneName); + LoadScene(SceneManager.GetActiveScene().name); } - public void LoadScene(string sceneName) + public async void LoadScene(string sceneName) { - VisualFeedbackManager.Instance.ResetTimeScale(); - SceneManager.LoadScene(sceneName); - } - - public void MoveMainMenu() - { - VisualFeedbackManager.Instance.ResetTimeScale(); - SceneManager.LoadScene("00.TycoonTitle"); - } - - private void MoveCombatScene() - { - _isMovedCombatScene = true; - SceneManager.LoadScene("01.Tycoon"); - } - - private void OnSceneLoaded(Scene scene, LoadSceneMode mode) - { - PopupUiController.ClearPopup(); + _fadeIn.Restart(); + await _fadeIn.AsyncWaitForCompletion(); - if (scene.name == "01.Tycoon") + _loadingPanelFadeIn.Restart(); + await _loadingPanelFadeIn.AsyncWaitForCompletion(); + + AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(sceneName); + asyncOperation.allowSceneActivation = false; + + while (!asyncOperation.isDone) { - if (_isMovedCombatScene) + if (asyncOperation.progress >= 0.9f) // 로딩 완료 상태 { - _fadeOut.Restart(); - _isMovedCombatScene = false; + break; } + await Task.Yield(); } + + asyncOperation.allowSceneActivation = true; + await Task.Delay((int)(_loadingWaitTime * 1000)); + + _fadeOut.Restart(); + _loadingPanelFadeOut.Restart(); + Task[] fadeOutTasks = + { + _fadeOut.AsyncWaitForCompletion(), + _loadingPanelFadeOut.AsyncWaitForCompletion() + }; + + await Task.WhenAll(fadeOutTasks); + + PopupUiController.ClearPopup(); + VisualFeedbackManager.Instance.ResetTimeScale(); } } } \ No newline at end of file diff --git a/Assets/02.Scripts/Tycoon/LiquidController.cs b/Assets/02.Scripts/Tycoon/LiquidController.cs index 602f67240..1f74b37cf 100644 --- a/Assets/02.Scripts/Tycoon/LiquidController.cs +++ b/Assets/02.Scripts/Tycoon/LiquidController.cs @@ -195,10 +195,9 @@ namespace BlueWater while (_elapsedTime >= _timeInterval) { - // 술이 완성되었을 때 - if (_instanceLiquidCount >= _maxLiquidCount) + if (!currentBarrel.CanConsume(1)) { - StartCoroutine(nameof(CompleteCocktail)); + HandleBarrelCancelInteraction(); return; } @@ -224,6 +223,13 @@ namespace BlueWater currentBarrel.Consume(1); _elapsedTime -= _timeInterval; + + // 술이 완성되었을 때 + if (_instanceLiquidCount >= _maxLiquidCount) + { + StartCoroutine(nameof(CompleteCocktail)); + return; + } } } diff --git a/Assets/02.Scripts/Tycoon/TycoonCardController.cs b/Assets/02.Scripts/Tycoon/TycoonCardController.cs index 62cb4b71e..92854856c 100644 --- a/Assets/02.Scripts/Tycoon/TycoonCardController.cs +++ b/Assets/02.Scripts/Tycoon/TycoonCardController.cs @@ -25,6 +25,7 @@ namespace BlueWater.Tycoons private TycoonManager _tycoonManager; private TycoonStatus _tycoonStatus; + [ShowInInspector] public Dictionary SelectedCard { get; private set; } private void Start() diff --git a/Assets/02.Scripts/Ui/PopupUiController.cs b/Assets/02.Scripts/Ui/PopupUiController.cs index 711c25c8b..cd7300eda 100644 --- a/Assets/02.Scripts/Ui/PopupUiController.cs +++ b/Assets/02.Scripts/Ui/PopupUiController.cs @@ -27,6 +27,7 @@ namespace BlueWater { if (PopupUis.Contains(popup)) { + popup.DisableInput(); PopupUis.Remove(popup); if (PopupUis.Count > 0) diff --git a/Assets/02.Scripts/Ui/Title/TitleMenuButton.cs b/Assets/02.Scripts/Ui/Title/TitleMenuButton.cs index e4d8dff21..07d585da0 100644 --- a/Assets/02.Scripts/Ui/Title/TitleMenuButton.cs +++ b/Assets/02.Scripts/Ui/Title/TitleMenuButton.cs @@ -1,3 +1,4 @@ +using System; using BlueWater.Tycoons; using Sirenix.OdinInspector; using UnityEngine; @@ -25,6 +26,18 @@ namespace BlueWater.Titles _isQuitting = true; } + private void OnEnable() + { + if (EventSystem.current.currentSelectedGameObject != gameObject) return; + + _selectedImage.enabled = true; + } + + private void OnDisable() + { + _selectedImage.enabled = false; + } + public void OnSelect(BaseEventData eventData) { _selectedImage.color = _originalColor; diff --git a/Assets/02.Scripts/Ui/Title/TitleQuit.cs b/Assets/02.Scripts/Ui/Title/TitleQuit.cs deleted file mode 100644 index 3869f6d65..000000000 --- a/Assets/02.Scripts/Ui/Title/TitleQuit.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using BlueWater; -using BlueWater.Uis; -using UnityEngine; -using UnityEngine.EventSystems; -using UnityEngine.InputSystem; -using UnityEngine.UI; - -public class TitleQuit : PopupUi -{ - [SerializeField] - private GameObject _panel; - - private InputAction _interactionEAction; - private InputAction _closeOptionsAction; - public Action CloseQuit; - - private void Start() - { - _interactionEAction = PlayerInputKeyManager.Instance.GetAction(InputActionMaps.TycoonUi, TycoonUiActions.InteractionE); - _closeOptionsAction = PlayerInputKeyManager.Instance.GetAction(InputActionMaps.TycoonUi, TycoonUiActions.Cancel); - } - - private void OnDestroy() - { - if (_interactionEAction != null) - { - _interactionEAction.performed -= OnInteractionE; - } - - if (_closeOptionsAction != null) - { - _closeOptionsAction.performed -= OnCloseOptions; - } - } - - public override void Open() - { - PopupUiController.RegisterPopup(this); - _panel.SetActive(true); - IsOpened = true; - } - - public override void Close() - { - _panel.SetActive(false); - PopupUiController.UnregisterPopup(this); - IsOpened = false; - } - - public override void EnableInput() - { - _interactionEAction.performed += OnInteractionE; - _closeOptionsAction.performed += OnCloseOptions; - } - - public override void DisableInput() - { - _interactionEAction.performed -= OnInteractionE; - _closeOptionsAction.performed -= OnCloseOptions; - } - - public void OnInteractionE(InputAction.CallbackContext context) - { - var current = EventSystem.current.currentSelectedGameObject; - if (!current) return; - - var currenButton = current.GetComponent