add customize データ周り
This commit is contained in:
parent
5ec071fdf7
commit
993456972b
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace MyGame.Scenes.marketing.Scripts
|
||||
{
|
||||
[DataContract]
|
||||
public class ShopCustomizeSettings
|
||||
{
|
||||
[DataMember]
|
||||
public int SignBoard = Const.ShopCustomizeDefaultSignBoardId;
|
||||
[DataMember]
|
||||
public int Decoration1 = Const.ShopCustomizeDefaultDecoration1Id;
|
||||
[DataMember]
|
||||
public int Cart = Const.ShopCustomizeDefaultCartId;
|
||||
[DataMember]
|
||||
public int Stock = Const.ShopCustomizeDefaultStockId;
|
||||
[DataMember]
|
||||
public int Decoration2 = Const.ShopCustomizeDefaultDecoration2Id; // 立て看板
|
||||
|
||||
public int GetSetting(ShopCustomizeCategory category)
|
||||
{
|
||||
switch (category)
|
||||
{
|
||||
case ShopCustomizeCategory.Category1:
|
||||
return SignBoard;
|
||||
case ShopCustomizeCategory.Category2:
|
||||
return Decoration1;
|
||||
case ShopCustomizeCategory.Category3:
|
||||
return Cart;
|
||||
case ShopCustomizeCategory.Category4:
|
||||
return Stock;
|
||||
case ShopCustomizeCategory.Category5:
|
||||
return Decoration2;
|
||||
case ShopCustomizeCategory.Category6:
|
||||
return 0;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(category), category, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 395f055656374dfd815a6754b6ff54fc
|
||||
timeCreated: 1652246064
|
||||
|
|
@ -25,6 +25,11 @@ public static class Const {
|
|||
public static readonly float VipCustomerRewardStock = 20; // Market.ShopStockCount以下にする
|
||||
public static readonly float VipCustomerRewardRate = 0.1f;
|
||||
public static readonly int AutoCookAvailableLevel = 7;
|
||||
public static readonly int ShopCustomizeDefaultSignBoardId = 1;
|
||||
public static readonly int ShopCustomizeDefaultDecoration1Id = 2;
|
||||
public static readonly int ShopCustomizeDefaultCartId = 3;
|
||||
public static readonly int ShopCustomizeDefaultStockId = 4;
|
||||
public static readonly int ShopCustomizeDefaultDecoration2Id = 5;
|
||||
|
||||
// tag
|
||||
public static readonly string GameDataTag = "GameData";
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using MyGame.Scenes.marketing.Scripts;
|
||||
using MyGame.Scripts;
|
||||
|
||||
public enum AdRewardType {
|
||||
|
|
@ -162,6 +163,18 @@ public sealed class GameData {
|
|||
[DataMember(Name = "Data56")]
|
||||
public int[] AutoCookProducts;
|
||||
|
||||
// カスタマイズ機能(v1.3追加)
|
||||
[DataMember(Name = "Data57")]
|
||||
public int ShopCustomizeCoin;
|
||||
[DataMember(Name = "Data58")]
|
||||
public int ShopCustomizePoint;
|
||||
[DataMember(Name = "Data59")]
|
||||
public int ShopCustomizeLevel;
|
||||
[DataMember(Name = "Data60")]
|
||||
public int[] ShopCustomizeMyItems;
|
||||
[DataMember(Name = "Data61")]
|
||||
public ShopCustomizeSettings ShopCustomizeSettings;
|
||||
|
||||
|
||||
// mission
|
||||
[DataMember(Name = "Data1001")]
|
||||
|
|
@ -397,6 +410,11 @@ public sealed class GameData {
|
|||
AutoCookLevel = 1;
|
||||
}
|
||||
|
||||
if (ShopCustomizeLevel < 1)
|
||||
{
|
||||
ShopCustomizeLevel = 0;
|
||||
}
|
||||
|
||||
// 追加した要素の初期化用
|
||||
// TODO Release前にまっさらにする
|
||||
}
|
||||
|
|
@ -418,6 +436,7 @@ public sealed class GameData {
|
|||
DailyTotalSalesList = DailyTotalSalesList ?? new List<ProductStockData>();
|
||||
WaitAddStock = WaitAddStock ?? new ProductStockData{Rarity = ProductRarity.Normal};
|
||||
AutoCookProducts = AutoCookProducts ?? Array.Empty<int>();
|
||||
ShopCustomizeSettings = ShopCustomizeSettings ?? new ShopCustomizeSettings();
|
||||
}
|
||||
private Dictionary<int, int> ArrayToDictionary(KeyValueOfintint[] array){
|
||||
var dictionary = new Dictionary<int, int>();
|
||||
|
|
|
|||
|
|
@ -453,6 +453,11 @@ public sealed class ShopCustomizeData {
|
|||
public int point;
|
||||
public string prefabName;
|
||||
public ShopCustomizeCategory Category => (ShopCustomizeCategory)category;
|
||||
|
||||
public Transform GetPrefab()
|
||||
{
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
|
|
|||
Loading…
Reference in New Issue