// 此文件由 ThriftIntegratedPipeline 自动生成,请勿手动修改 // 配置类: ShopSpecial // 数据类: ShopSpecialItem using UnityEngine; using Byway.Config; using Byway.Thrift.Data; using UnityGameFramework.Runtime; namespace CrazyMaple { /// /// ShopSpecial 数据行 /// public class DRShopSpecial : DataRowBase { private ShopSpecialItem _configData; /// /// 唯一标识 /// public override int Id { get { return _configData?.Id ?? 0; } } /// /// Type /// public int Type { get { return _configData?.Type ?? 0; } } /// /// SortId /// public int SortId { get { return _configData?.SortId ?? 0; } } /// /// ItemReward /// public string ItemReward { get { return _configData?.ItemReward ?? ""; } } /// /// PayPrice /// public float PayPrice { get { return System.Convert.ToSingle(_configData?.PayPrice ?? 0.0); } } /// /// 从配置加载数据 /// public void LoadFromConfig(int id) { var config = ConfigManager.Instance.GetConfig(); if (config?.Shopspecials != null) { config.Shopspecials.TryGetValue(id, out _configData); } } /// /// 解析数据行(兼容旧系统,实际使用 LoadFromConfig) /// public override bool ParseDataRow(string dataRowString, object userData) { int id = 0; if (int.TryParse(dataRowString, out id)) { LoadFromConfig(id); return _configData != null; } return false; } } }