VIP宣伝フラグ判定追加
This commit is contained in:
parent
3ba046e754
commit
fbccefe07c
|
|
@ -7,6 +7,7 @@ using TMPro;
|
||||||
using UniRx;
|
using UniRx;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using Random = UnityEngine.Random;
|
||||||
|
|
||||||
public class CookingResult : MonoBehaviour
|
public class CookingResult : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
@ -140,6 +141,19 @@ public class CookingResult : MonoBehaviour
|
||||||
{
|
{
|
||||||
// 獲得、遷移
|
// 獲得、遷移
|
||||||
MoveStock(GameDataManager.GameData.WaitAddStock);
|
MoveStock(GameDataManager.GameData.WaitAddStock);
|
||||||
|
|
||||||
|
// 確率でVip宣伝
|
||||||
|
if (GameDataManager.GameData.ShopStock.Count >= Const.VipCustomerRewardStock)
|
||||||
|
{
|
||||||
|
if (Random.value <= Const.VipCustomerRewardRate)
|
||||||
|
{
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
Debug.Log($"flag VipReward");
|
||||||
|
#endif
|
||||||
|
GameDataManager.GameData.vipCustomerFirstOpen = true;
|
||||||
|
GameDataManager.GameData.vipCustomerLimitTime = DateTime.UtcNow.AddSeconds(60).ToBinary();
|
||||||
|
}
|
||||||
|
}
|
||||||
GameDataManager.SaveGameData();
|
GameDataManager.SaveGameData();
|
||||||
Market.Instance.IsPause.Value = false;
|
Market.Instance.IsPause.Value = false;
|
||||||
TransitionManager.Instance.LoadScene(GameScenes.Main);
|
TransitionManager.Instance.LoadScene(GameScenes.Main);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ public static class Const {
|
||||||
public static readonly int[] FieldTutorial = { 5, 12, 6 };
|
public static readonly int[] FieldTutorial = { 5, 12, 6 };
|
||||||
public static readonly int[] ShoppingTutorial = { 7, 13, 8};
|
public static readonly int[] ShoppingTutorial = { 7, 13, 8};
|
||||||
public static readonly int[] ManagementTutorial = { 9 };
|
public static readonly int[] ManagementTutorial = { 9 };
|
||||||
|
public static readonly float VipCustomerRewardStock = 20; // Market.ShopStockCount以下にする
|
||||||
|
public static readonly float VipCustomerRewardRate = 0.01f;
|
||||||
|
|
||||||
// tag
|
// tag
|
||||||
public static readonly string GameDataTag = "GameData";
|
public static readonly string GameDataTag = "GameData";
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,12 @@ public sealed class GameData {
|
||||||
public int WaitAddHeart;
|
public int WaitAddHeart;
|
||||||
[DataMember(Name = "Data42")]
|
[DataMember(Name = "Data42")]
|
||||||
public ProductStockData WaitAddStock;
|
public ProductStockData WaitAddStock;
|
||||||
|
|
||||||
|
// reward(v1.1追加)
|
||||||
|
[DataMember(Name = "Data51")]
|
||||||
|
public long vipCustomerLimitTime = DateTime.UtcNow.ToBinary();
|
||||||
|
[DataMember(Name = "Data52")]
|
||||||
|
public bool vipCustomerFirstOpen;
|
||||||
|
|
||||||
// mission
|
// mission
|
||||||
[DataMember(Name = "Data1001")]
|
[DataMember(Name = "Data1001")]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue