From f48cff7d691b08c54ba90da77c8d4e3856879e54 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 13 Dec 2021 11:06:31 +0900 Subject: [PATCH] =?UTF-8?q?=E5=BA=83=E5=91=8A=E8=A6=96=E8=81=B4UI=E8=AA=BF?= =?UTF-8?q?=E6=95=B4=E3=83=BB=E6=96=87=E8=A8=80=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Scenes/Main/WatchMovieCoin.unity | 5 +++ .../Assets/MyGame/Scripts/GetRewardDialog.cs | 36 ++++++++++--------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/Main/WatchMovieCoin.unity b/popcorn/Assets/MyGame/Scenes/Main/WatchMovieCoin.unity index 26e98551..68458983 100644 --- a/popcorn/Assets/MyGame/Scenes/Main/WatchMovieCoin.unity +++ b/popcorn/Assets/MyGame/Scenes/Main/WatchMovieCoin.unity @@ -1547,6 +1547,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 48fa1fc1b2ab4b229d8f7b26b9ad2401, type: 3} m_Name: m_EditorClassIdentifier: + coinMessage: "\u52D5\u753B\u3092\u898B\u308B\u3068\u30B3\u30A4\u30F3\u304C\u3082\u3089\u3048\u307E\u3059\uFF01\n\u52D5\u753B\u3092\u898B\u307E\u3059\u304B\uFF1F" + cornFieldMessage: "\u80A5\u6599\u3092\u4F7F\u3046\u3068\u4E00\u5B9A\u6642\u9593\u30B3\u30FC\u30F3\u306E\n\u6210\u9577\u3092\u65E9\u3081\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\uFF01\n\u52D5\u753B\u3092\u898B\u3066\u80A5\u6599\u3092\u4F7F\u3044\u307E\u3059\u304B\uFF1F" + increaseCustomerMessage: "\u5BA3\u4F1D\u3092\u3059\u308B\u3068\u4E00\u5B9A\u6642\u9593\n\u304A\u5E97\u306E\u524D\u3092\u901A\u308B\u4EBA\u304C\u5897\u3048\u307E\u3059\uFF01\n\u52D5\u753B\u3092\u898B\u3066\u304A\u5E97\u3092\u5BA3\u4F1D\u3057\u307E\u3059\u304B\uFF1F" + perfectPopcornMessage: "\u52D5\u753B\u3092\u898B\u3066\u5927\u6210\u529F\u306B\u3057\u307E\u3059\u304B\uFF1F" backgroundAnimator: {fileID: 1298517019} closeButton: {fileID: 4540746} okButton: {fileID: 208413211} @@ -1558,6 +1562,7 @@ MonoBehaviour: narrowWindow: {fileID: 1450516236} coinObject: {fileID: 1081810292} fertilizerObject: {fileID: 471677967} + publicityObject: {fileID: 262919494} --- !u!1 &1450516236 GameObject: m_ObjectHideFlags: 0 diff --git a/popcorn/Assets/MyGame/Scripts/GetRewardDialog.cs b/popcorn/Assets/MyGame/Scripts/GetRewardDialog.cs index 47903203..0bd00e0f 100644 --- a/popcorn/Assets/MyGame/Scripts/GetRewardDialog.cs +++ b/popcorn/Assets/MyGame/Scripts/GetRewardDialog.cs @@ -17,14 +17,16 @@ namespace MyGame.Scripts } private static readonly string OkCallbackTag = "GetRewardDialogOkCallbackTag"; private static readonly string RewardTypeTag = "GetRewardDialogRewardTypeTag"; - private static readonly string coinMessage = "動画を見て兄弟を休憩させると\nコインがもらえます!\n動画を見ますか?"; - private static readonly string cornFieldMessage = "肥料を使うと一定時間\nコーンの成長を早めることができます\n動画を見て肥料を使いますか?"; - private static readonly string increaseCustomerMessage = "動画を見てお店を宣伝しますか?"; - private static readonly string perfectPopcornMessage = "動画を見て大成功にしますか?"; + [Multiline(4)][SerializeField] private string coinMessage = "動画を見て兄弟を休憩させると\nコインがもらえます!\n動画を見ますか?"; + [Multiline(4)][SerializeField] private string cornFieldMessage = "肥料を使うと一定時間\nコーンの成長を早めることができます\n動画を見て肥料を使いますか?"; + [Multiline(4)][SerializeField] private string increaseCustomerMessage = "動画を見てお店を宣伝しますか?"; + [Multiline(4)][SerializeField] private string perfectPopcornMessage = "動画を見て大成功にしますか?"; + private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger"); private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger"); + [Space] [SerializeField] private Animator backgroundAnimator; [SerializeField] private Button closeButton; [SerializeField] private Button okButton; @@ -36,38 +38,38 @@ namespace MyGame.Scripts [SerializeField] private GameObject narrowWindow; [SerializeField] private GameObject coinObject; [SerializeField] private GameObject fertilizerObject; + [SerializeField] private GameObject publicityObject; private void Start() { + narrowWindow.SetActive(false); + coinObject.SetActive(false); + fertilizerObject.SetActive(false); + publicityObject.SetActive(false); switch (LocalCacheManager.Load(RewardTypeTag)) { case RewardType.Coin: normalWindow.SetActive(true); - narrowWindow.SetActive(!normalWindow.activeSelf); coinObject.SetActive(true); - fertilizerObject.SetActive(!coinObject.activeSelf); messageText.text = coinMessage; SetButtonAction(closeButton, okButton); break; case RewardType.CornField: normalWindow.SetActive(true); - narrowWindow.SetActive(!normalWindow.activeSelf); - coinObject.SetActive(false); - fertilizerObject.SetActive(!coinObject.activeSelf); + fertilizerObject.SetActive(true); messageText.text = cornFieldMessage; SetButtonAction(closeButton, okButton); break; case RewardType.IncreaseCustomer: - normalWindow.transform.SetLocalScale(0); - narrowWindow.SetActive(true); - narrowMessageText.text = increaseCustomerMessage; - SetButtonAction(narrowCloseButton, narrowOkButton); + normalWindow.SetActive(true); + publicityObject.SetActive(true); + messageText.text = increaseCustomerMessage; + SetButtonAction(closeButton, okButton); break; case RewardType.PerfectPopcorn: - normalWindow.transform.SetLocalScale(0); - narrowWindow.SetActive(true); - narrowMessageText.text = perfectPopcornMessage; - SetButtonAction(narrowCloseButton, narrowOkButton); + normalWindow.SetActive(true); + messageText.text = perfectPopcornMessage; + SetButtonAction(closeButton, okButton); break; default: throw new ArgumentOutOfRangeException();