diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/FryingPanExplanation.unity b/popcorn/Assets/MyGame/Scenes/Cooking/FryingPanExplanation.unity index cd3c8eb6..a000c860 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/FryingPanExplanation.unity +++ b/popcorn/Assets/MyGame/Scenes/Cooking/FryingPanExplanation.unity @@ -356,9 +356,9 @@ Canvas: m_GameObject: {fileID: 775136395} m_Enabled: 1 serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 + m_RenderMode: 1 + m_Camera: {fileID: 887756073} + m_PlaneDistance: 0 m_PixelPerfect: 0 m_ReceivesEvents: 1 m_OverrideSorting: 0 @@ -366,7 +366,7 @@ Canvas: m_SortingBucketNormalizedSize: 0 m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 - m_SortingOrder: 100 + m_SortingOrder: 200 m_TargetDisplay: 0 --- !u!224 &775136399 RectTransform: @@ -389,6 +389,81 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} +--- !u!1001 &887756072 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 9117079084301130545, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9117079084301130545, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9117079084301130545, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9117079084301130545, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9117079084301130545, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 9117079084301130545, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9117079084301130545, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9117079084301130545, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9117079084301130545, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9117079084301130545, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9117079084301130545, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9117079084301130547, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + propertyPath: m_Name + value: UICamera + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 021717b65b165374faa3fcffaafedfc2, type: 3} +--- !u!20 &887756073 stripped +Camera: + m_CorrespondingSourceObject: {fileID: 9117079084301130544, guid: 021717b65b165374faa3fcffaafedfc2, + type: 3} + m_PrefabInstance: {fileID: 887756072} + m_PrefabAsset: {fileID: 0} --- !u!1 &934937456 GameObject: m_ObjectHideFlags: 0 @@ -398,6 +473,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 934937457} + - component: {fileID: 934937458} m_Layer: 5 m_Name: Window m_TagString: Untagged @@ -426,6 +502,20 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 89} m_SizeDelta: {x: 705, y: 705} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &934937458 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 934937456} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a5115b57d3e74b55b4cc16996fd3338d, type: 3} + m_Name: + m_EditorClassIdentifier: + backgroundAnimator: {fileID: 593550067} + closeButton: {fileID: 1240037376} --- !u!1 &1240037373 GameObject: m_ObjectHideFlags: 0 diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/GameGuideDialog.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/GameGuideDialog.cs new file mode 100644 index 00000000..12fb6a0a --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/GameGuideDialog.cs @@ -0,0 +1,35 @@ +using System; +using UniRx; +using UnityEngine; +using UnityEngine.UI; + +public class GameGuideDialog : MonoBehaviour +{ + private static readonly string CallbackTag = "GameGuideDialogCallback"; + private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger"); + private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger"); + + [SerializeField] private Animator backgroundAnimator; + [SerializeField] private Button closeButton; + + private void Start() + { + closeButton.OnClickAsObservable().Take(1).Subscribe(_ => + { + transform.SetLocalScale(0); + backgroundAnimator.SetTrigger(CloseTrigger); + this.CallWaitForSeconds(.25f, () => + { + LocalCacheManager.Load(CallbackTag, null)?.Invoke(); + LocalCacheManager.Remove(CallbackTag); + TransitionManager.Instance.UnloadScene(GameScenes.FryingPanExplanation); + }); + }).AddTo(this); + } + + public static void ShowDialog(Action onClose = null) + { + LocalCacheManager.Save(CallbackTag, onClose); + TransitionManager.Instance.LoadSceneAdditive(GameScenes.FryingPanExplanation); + } +} diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/GameGuideDialog.cs.meta b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/GameGuideDialog.cs.meta new file mode 100644 index 00000000..15f2be47 --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/GameGuideDialog.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a5115b57d3e74b55b4cc16996fd3338d +timeCreated: 1635498450 \ No newline at end of file diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameManager.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameManager.cs index c83833e2..d4ff46e5 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameManager.cs @@ -84,8 +84,11 @@ public class PopcornGameManager : MonoBehaviour state.SetValueAndForceNotify(GameState.TutorialBeforeGuide); TutorialManager.Instance.ShowTutorialConversation(8, () => { - state.SetValueAndForceNotify(GameState.Guide); - cornManager.SetCornsActive(true); + GameGuideDialog.ShowDialog(() => + { + state.SetValueAndForceNotify(GameState.Guide); + cornManager.SetCornsActive(true); + }); }); } } diff --git a/popcorn/Assets/MyGame/Scripts/TransitionManager.cs b/popcorn/Assets/MyGame/Scripts/TransitionManager.cs index 501c04e3..9dbfb4de 100644 --- a/popcorn/Assets/MyGame/Scripts/TransitionManager.cs +++ b/popcorn/Assets/MyGame/Scripts/TransitionManager.cs @@ -9,6 +9,7 @@ public enum GameScenes Main, Cooking, CookingResults, + FryingPanExplanation, CornField, Reinforcement, ReinforcementDetail, diff --git a/popcorn/ProjectSettings/EditorBuildSettings.asset b/popcorn/ProjectSettings/EditorBuildSettings.asset index 61af798f..7da769c8 100644 --- a/popcorn/ProjectSettings/EditorBuildSettings.asset +++ b/popcorn/ProjectSettings/EditorBuildSettings.asset @@ -9,10 +9,10 @@ EditorBuildSettings: path: Assets/MyGame/Scenes/Main/Main.unity guid: 7f040d1b248234841802683edae3c4fa - enabled: 1 - path: Assets/MyGame/Scenes/Recipe/recipe.unity + path: Assets/MyGame/Scenes/recipe/recipe.unity guid: e3d17c6b649257641bd3b50559692087 - enabled: 1 - path: Assets/MyGame/Scenes/Recipe/RecipeChoice.unity + path: Assets/MyGame/Scenes/recipe/RecipeChoice.unity guid: 303178fa574d90d4f81046cb6a3a1b9c - enabled: 1 path: Assets/MyGame/Scenes/Cooking/Cooking.unity @@ -20,6 +20,9 @@ EditorBuildSettings: - enabled: 1 path: Assets/MyGame/Scenes/Cooking/CookingResults.unity guid: c3b63388aa238ca4cbe0de288bdbfa9c + - enabled: 1 + path: Assets/MyGame/Scenes/Cooking/FryingPanExplanation.unity + guid: 47dd0a048965e064eb1d3a4330f18fd2 - enabled: 1 path: Assets/MyGame/Scenes/CornField/CornField.unity guid: 7ee833196453c8045b9ec713662ccf4e @@ -36,13 +39,13 @@ EditorBuildSettings: path: Assets/MyGame/Scenes/marketing/Tasting.unity guid: 79a0196644bebaa49a6d8e1df6ada879 - enabled: 1 - path: Assets/MyGame/Scenes/Shopping/shopping.unity + path: Assets/MyGame/Scenes/shopping/shopping.unity guid: 9c9b9e2851656c84e91e3c457a81433d - enabled: 1 - path: Assets/MyGame/Scenes/Shopping/ShoppingExplanation.unity + path: Assets/MyGame/Scenes/shopping/ShoppingExplanation.unity guid: 56dcb15cfd0593b4ab5045ee38a03b1f - enabled: 1 - path: Assets/MyGame/Scenes/Shopping/Purchase.unity + path: Assets/MyGame/Scenes/shopping/Purchase.unity guid: 6cdf801ecd42cd543a2b68afba311048 - enabled: 1 path: Assets/MyGame/Scenes/DebugOption/DebugOption.unity