85 lines
2.8 KiB
C#
85 lines
2.8 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
|
|
[CreateAssetMenu(fileName = "77xxx_storeItem", menuName = "Store/StoreItem")]
|
|
public class storeItemSO : ScriptableObject
|
|
{
|
|
[Header("Basic Info")]
|
|
public string itemName;
|
|
public Sprite itemIcon;
|
|
public int itemID; // Unique identifier for the item
|
|
public int itemSinglePurchaseQty; // 物品单次购买数量
|
|
public int itemPurchaseQuota; // 物品限购配额,-1为不限购
|
|
[TextArea(3, 3)] public string itemDescription;
|
|
[TextArea(3, 10)] public string itemDetailedDescription; // 这个是用来在物品详情界面显示的更详细的描述文本的
|
|
|
|
[Header("Item Type")]
|
|
public bool isOnShelf = true; // Indicates if the item is currently available for purchase
|
|
public bool canbepurchased = true; // Indicates if the item can be purchased with coins
|
|
public bool isHot = false; // Indicates if the item is a hot item (for promotional purposes)
|
|
public bool user_has_read = false; // 用户是否已经查看过这个物品
|
|
public ItemType itemType;
|
|
[FormerlySerializedAs("associatedPlayer")]
|
|
public AllyHero_SO associatedAllyHero; // Only used if itemType is character
|
|
public SongData associatedSong; // Only used if itemType is song
|
|
public notebook_faterType associatedStoryPassage; // Only used if itemType is storyPassage
|
|
public StoryPassageGrantMode storyPassageGrantMode = StoryPassageGrantMode.fatherOnly;
|
|
public int associatedStorySonId = -1;
|
|
public expBottlesSO associatedExpBottle; // Only used by single-target exp bottles such as 78001-78006
|
|
public growthMaterialSO associatedGrowthMaterial; // Only used by breakthrough materials such as 78021-78024
|
|
|
|
[Header("Purchase Cost")]
|
|
public List<CostRequirement> costRequirements = new List<CostRequirement>();
|
|
|
|
[Header("Unlock Conditions")]
|
|
public List<UnlockRequirement> unlockRequirements = new List<UnlockRequirement>();
|
|
|
|
[Header("Runtime Save Data")]
|
|
public int purchasedCount; // 已购数量,会参与持久化
|
|
|
|
public enum ItemType
|
|
{
|
|
character,
|
|
song,
|
|
storyPassage,
|
|
consumable,
|
|
otherType
|
|
}
|
|
|
|
public enum CurrencyType
|
|
{
|
|
coins,
|
|
}
|
|
|
|
public enum StoryPassageGrantMode
|
|
{
|
|
fatherOnly,
|
|
specificSonOnly,
|
|
fatherAndSpecificSon,
|
|
allSons
|
|
}
|
|
|
|
public enum RequirementType
|
|
{
|
|
none,
|
|
level,
|
|
clearSong,
|
|
storyProgress
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class CostRequirement
|
|
{
|
|
public CurrencyType currencyType;
|
|
public int amount;
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class UnlockRequirement
|
|
{
|
|
public RequirementType requirementType;
|
|
public int value;
|
|
}
|
|
}
|