サンフランシスコ都市店舗レベル2のときアップデート待ってねポップ表示
This commit is contained in:
parent
1c2673d766
commit
a9426fc30d
|
@ -6,9 +6,15 @@ using UnityEngine.UI;
|
|||
|
||||
namespace MyGame.Scenes.Main.Scripts
|
||||
{
|
||||
public enum DialogType
|
||||
{
|
||||
MaxShopLevel,
|
||||
MaxCityShopLevel
|
||||
}
|
||||
public class UpdateDialog : MonoBehaviour
|
||||
{
|
||||
private static readonly string CallbackTag = "UpdateDialogCallback";
|
||||
private static readonly string DialogTypeTag = "UpdateDialogType";
|
||||
private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger");
|
||||
private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger");
|
||||
private static readonly GameScenes SceneName = GameScenes.Update;
|
||||
|
@ -19,6 +25,8 @@ namespace MyGame.Scenes.Main.Scripts
|
|||
|
||||
private void Start()
|
||||
{
|
||||
var dialogType = LocalCacheManager.Load<DialogType>(DialogTypeTag);
|
||||
LocalCacheManager.Remove(DialogTypeTag);
|
||||
closeButton.OnClickAsObservable().Take(1).Subscribe(_ =>
|
||||
{
|
||||
LocalCacheManager.Load<Action>(CallbackTag, null)?.Invoke();
|
||||
|
@ -31,12 +39,23 @@ namespace MyGame.Scenes.Main.Scripts
|
|||
});
|
||||
}).AddTo(this);
|
||||
|
||||
updateMessageText.text = string.Format(ScriptLocalization.System.LevelUpdateComingSoon, Const.MaxShopLevel + 1);
|
||||
updateMessageText.text = dialogType switch
|
||||
{
|
||||
DialogType.MaxShopLevel => string.Format(ScriptLocalization.System.LevelUpdateComingSoon, Const.MaxShopLevel + 1),
|
||||
DialogType.MaxCityShopLevel => ScriptLocalization.System.CityLevelUpComingSoon,
|
||||
// _ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
}
|
||||
|
||||
public static void ShowDialog(Action onClose = null){
|
||||
LocalCacheManager.Save(CallbackTag, onClose);
|
||||
TransitionManager.Instance.LoadSceneAdditive(SceneName);
|
||||
}
|
||||
|
||||
public static void ShowCityDialog(Action onClose = null){
|
||||
LocalCacheManager.Save(CallbackTag, onClose);
|
||||
LocalCacheManager.Save(DialogTypeTag, DialogType.MaxCityShopLevel);
|
||||
TransitionManager.Instance.LoadSceneAdditive(SceneName);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -38,6 +38,7 @@ public static class Const {
|
|||
public static readonly int ScrollGameAvailableLevel = 8;
|
||||
public static readonly int WorldMapTutorialScriptId = 21;
|
||||
public static readonly int WorldTripLimitScriptId = 25;
|
||||
public static readonly (int cityId,int cityLevel) MaxCityLevel = (2, 2);
|
||||
|
||||
// tag
|
||||
public static readonly string GameDataTag = "GameData";
|
||||
|
|
|
@ -91,7 +91,8 @@ public class HeaderManager : MonoBehaviour
|
|||
if (levelUpScripts.Count <= 0) return;
|
||||
BrotherConversation.ShowDialog(levelUpScripts, () =>
|
||||
{
|
||||
// 既読処理(必要なら
|
||||
if (cityGameData.ViewedShopLevel < Const.MaxCityLevel.cityLevel) return;
|
||||
UpdateDialog.ShowCityDialog();
|
||||
});
|
||||
}).AddTo(this);
|
||||
|
||||
|
|
|
@ -14831,6 +14831,17 @@ MonoBehaviour:
|
|||
-
|
||||
Flags: 0000000000
|
||||
Languages_Touch: []
|
||||
- Term: System/CityLevelUpComingSoon
|
||||
TermType: 0
|
||||
Description:
|
||||
Languages:
|
||||
- "\u7D9A\u304D\u306F\n\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3092\u5F85\u3063\u3066\u306D"
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
Flags: 0000000000
|
||||
Languages_Touch: []
|
||||
CaseInsensitiveTerms: 0
|
||||
OnMissingTranslation: 3
|
||||
mTerm_AppName:
|
||||
|
|
|
@ -21,6 +21,7 @@ namespace I2.Loc
|
|||
public static string PerfectPopcornMessage { get{ return LocalizationManager.GetTranslation ("System/PerfectPopcornMessage"); } }
|
||||
public static string VipCustomerMessage { get{ return LocalizationManager.GetTranslation ("System/VipCustomerMessage"); } }
|
||||
public static string LevelUpdateComingSoon { get{ return LocalizationManager.GetTranslation ("System/LevelUpdateComingSoon"); } }
|
||||
public static string CityLevelUpComingSoon { get{ return LocalizationManager.GetTranslation ("System/CityLevelUpComingSoon"); } }
|
||||
}
|
||||
|
||||
public static class UI
|
||||
|
@ -77,6 +78,7 @@ namespace I2.Loc
|
|||
public const string PerfectPopcornMessage = "System/PerfectPopcornMessage";
|
||||
public const string VipCustomerMessage = "System/VipCustomerMessage";
|
||||
public const string LevelUpdateComingSoon = "System/LevelUpdateComingSoon";
|
||||
public const string CityLevelUpComingSoon = "System/CityLevelUpComingSoon";
|
||||
}
|
||||
|
||||
public static class UI
|
||||
|
|
Loading…
Reference in New Issue