From 43f26fe8bef9b639bcfdf3e3eac433d961e9416d Mon Sep 17 00:00:00 2001 From: kimura Date: Tue, 17 May 2022 11:41:16 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AB=E3=82=B9=E3=82=BF=E3=83=9E=E3=82=A4?= =?UTF-8?q?=E3=82=BA=E6=A9=9F=E8=83=BD=E3=83=81=E3=83=A5=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=83=AA=E3=82=A2=E3=83=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DebugOption/Scripts/DebugOptionManager.cs | 1 + .../marketing/CustomizeExplanation.unity | 15 ++++++++ .../Scenes/marketing/Scripts/ShopCustomize.cs | 7 ++++ .../Scripts/ShopCustomizeTutorialDialog.cs | 38 +++++++++++++++++++ .../ShopCustomizeTutorialDialog.cs.meta | 3 ++ .../MyGame/Scripts/TransitionManager.cs | 1 + .../ProjectSettings/EditorBuildSettings.asset | 3 ++ 7 files changed, 68 insertions(+) create mode 100644 popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomizeTutorialDialog.cs create mode 100644 popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomizeTutorialDialog.cs.meta diff --git a/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs b/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs index 72ab531e..fe290636 100644 --- a/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs +++ b/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs @@ -171,6 +171,7 @@ public class DebugOptionManager : MonoBehaviour resetShopCustomizeButton.OnClickAsObservable().Subscribe(_ => { + gameData.FinishedFlags &= ~TutorialFlag.ShopCustomize; gameData.ShopCustomizeLevel = 1; gameData.ShopCustomizePoint = 0; gameData.ShopCustomizeCoin = 0; diff --git a/popcorn/Assets/MyGame/Scenes/marketing/CustomizeExplanation.unity b/popcorn/Assets/MyGame/Scenes/marketing/CustomizeExplanation.unity index d22ba429..442f6545 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/CustomizeExplanation.unity +++ b/popcorn/Assets/MyGame/Scenes/marketing/CustomizeExplanation.unity @@ -897,6 +897,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 2062451052} + - component: {fileID: 2062451053} m_Layer: 5 m_Name: Window m_TagString: Untagged @@ -925,3 +926,17 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 126} m_SizeDelta: {x: 882, y: 900} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2062451053 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2062451051} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2c9f1da19b6645aba2dd31af17ba8e48, type: 3} + m_Name: + m_EditorClassIdentifier: + backgroundAnimator: {fileID: 1361525442} + closeButton: {fileID: 1019858970} diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs index 8e6dbc51..855043a7 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using MyGame.Scripts; using UniRx; using UnityEngine; @@ -18,6 +19,12 @@ namespace MyGame.Scenes.marketing.Scripts var customizeLevelList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ShopCustomizeLevelDataSheet); var customizeBonusList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ShopCustomizeBonusDataSheet); + if (!gameData.FinishedFlags.HasFlag(TutorialFlag.ShopCustomize)) + { + gameData.FinishedFlags |= TutorialFlag.ShopCustomize; + GameDataManager.SaveGameData(); + ShopCustomizeTutorialDialog.ShowDialog(); + } customizeView.SetLevel(gameData.ShopCustomizeLevel); customizeView.OnCloseObservable.Subscribe(_ => { diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomizeTutorialDialog.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomizeTutorialDialog.cs new file mode 100644 index 00000000..45c4e8dd --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomizeTutorialDialog.cs @@ -0,0 +1,38 @@ +using System; +using I2.Loc; +using UniRx; +using UnityEngine; +using UnityEngine.UI; + +namespace MyGame.Scenes.marketing.Scripts +{ + public class ShopCustomizeTutorialDialog : MonoBehaviour + { + private static readonly string CallbackTag = "ShopCustomizeTutorialDialogCallback"; + 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(_ => + { + LocalCacheManager.Load(CallbackTag, null)?.Invoke(); + LocalCacheManager.Remove(CallbackTag); + transform.parent.SetLocalScale(0); + backgroundAnimator.SetTrigger(CloseTrigger); + this.CallWaitForSeconds(.25f, () => + { + TransitionManager.Instance.UnloadScene(GameScenes.CustomizeExplanation); + }); + }).AddTo(this); + } + + public static void ShowDialog(Action onClose = null){ + LocalCacheManager.Save(CallbackTag, onClose); + TransitionManager.Instance.LoadSceneAdditive(GameScenes.CustomizeExplanation); + } + } +} \ No newline at end of file diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomizeTutorialDialog.cs.meta b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomizeTutorialDialog.cs.meta new file mode 100644 index 00000000..cd3123f2 --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomizeTutorialDialog.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2c9f1da19b6645aba2dd31af17ba8e48 +timeCreated: 1652753561 \ No newline at end of file diff --git a/popcorn/Assets/MyGame/Scripts/TransitionManager.cs b/popcorn/Assets/MyGame/Scripts/TransitionManager.cs index d2016f6d..d2ad1773 100644 --- a/popcorn/Assets/MyGame/Scripts/TransitionManager.cs +++ b/popcorn/Assets/MyGame/Scripts/TransitionManager.cs @@ -48,6 +48,7 @@ public enum GameScenes CustomizationPurchase, CustomizationDetails, Customize, + CustomizeExplanation, } public enum SceneType diff --git a/popcorn/ProjectSettings/EditorBuildSettings.asset b/popcorn/ProjectSettings/EditorBuildSettings.asset index 62135fb8..be407fce 100644 --- a/popcorn/ProjectSettings/EditorBuildSettings.asset +++ b/popcorn/ProjectSettings/EditorBuildSettings.asset @@ -131,4 +131,7 @@ EditorBuildSettings: - enabled: 1 path: Assets/MyGame/Scenes/marketing/Customize.unity guid: 2f8b60ae067f8414da2feece40afcc8c + - enabled: 1 + path: Assets/MyGame/Scenes/marketing/CustomizeExplanation.unity + guid: dd7c837547bf89f489bc36b6a2ebbca4 m_configObjects: {}