调整部分数据表配置,优化 SpriteCache 功能
This commit is contained in:
@@ -16,8 +16,8 @@ public sealed partial class WeaponConfig : Luban.BeanBase
|
||||
{
|
||||
public WeaponConfig(ByteBuf _buf)
|
||||
{
|
||||
Id = _buf.ReadInt();
|
||||
Name = _buf.ReadString();
|
||||
WeaponType = (WeaponType)_buf.ReadInt();
|
||||
LogicType = _buf.ReadString();
|
||||
Rarity = (Rarity)_buf.ReadInt();
|
||||
Price = _buf.ReadInt();
|
||||
Attack = _buf.ReadInt();
|
||||
@@ -28,6 +28,8 @@ public sealed partial class WeaponConfig : Luban.BeanBase
|
||||
{int n0 = System.Math.Min(_buf.ReadSize(), _buf.Size);Modifiers = new System.Collections.Generic.List<modifier>(n0);for(var i0 = 0 ; i0 < n0 ; i0++) { modifier _e0; _e0 = modifier.Deserializemodifier(_buf); Modifiers.Add(_e0);}}
|
||||
Prefab = _buf.ReadString();
|
||||
Prefab_Ref = null;
|
||||
Sprite = _buf.ReadString();
|
||||
Sprite_Ref = null;
|
||||
}
|
||||
|
||||
public static WeaponConfig DeserializeWeaponConfig(ByteBuf _buf)
|
||||
@@ -36,13 +38,13 @@ public sealed partial class WeaponConfig : Luban.BeanBase
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 武器id
|
||||
/// 武器类型
|
||||
/// </summary>
|
||||
public readonly int Id;
|
||||
public readonly WeaponType WeaponType;
|
||||
/// <summary>
|
||||
/// 武器名
|
||||
/// 逻辑类型
|
||||
/// </summary>
|
||||
public readonly string Name;
|
||||
public readonly string LogicType;
|
||||
/// <summary>
|
||||
/// 道具品质
|
||||
/// </summary>
|
||||
@@ -77,6 +79,11 @@ public sealed partial class WeaponConfig : Luban.BeanBase
|
||||
/// </summary>
|
||||
public readonly string Prefab;
|
||||
public EntityConfig Prefab_Ref;
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
public readonly string Sprite;
|
||||
public SpriteConfig Sprite_Ref;
|
||||
|
||||
public const int __ID__ = 127041694;
|
||||
public override int GetTypeId() => __ID__;
|
||||
@@ -94,13 +101,14 @@ public sealed partial class WeaponConfig : Luban.BeanBase
|
||||
|
||||
foreach (var _e in Modifiers) { _e?.ResolveRef(tables); }
|
||||
Prefab_Ref = tables.TbEntityConfig.GetOrDefault(Prefab);
|
||||
Sprite_Ref = tables.TbSpriteConfig.GetOrDefault(Sprite);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "id:" + Id + ","
|
||||
+ "name:" + Name + ","
|
||||
+ "weaponType:" + WeaponType + ","
|
||||
+ "logicType:" + LogicType + ","
|
||||
+ "rarity:" + Rarity + ","
|
||||
+ "price:" + Price + ","
|
||||
+ "attack:" + Attack + ","
|
||||
@@ -110,6 +118,7 @@ public sealed partial class WeaponConfig : Luban.BeanBase
|
||||
+ "parameters:" + Luban.StringUtil.CollectionToString(Parameters) + ","
|
||||
+ "modifiers:" + Luban.StringUtil.CollectionToString(Modifiers) + ","
|
||||
+ "prefab:" + Prefab + ","
|
||||
+ "sprite:" + Sprite + ","
|
||||
+ "}";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user