Skip to content

P1 Unity: feat(attributes): 增加 AttributeType 与属性缓存模型 #51

Description

@AlianBlank

目的

在 Unity 客户端增加与服务端协议一致的属性类型定义和本地缓存模型,用于接收、保存和读取玩家属性。

原因

客户端 UI、战力展示、角色面板等功能需要稳定的本地读取入口。该模型必须跟随服务端 AttributeType 和协议字段,避免客户端手写一套含义不同的属性枚举。

对应服务端任务

  • Server #65:AttributeType 编号与属性重算核心
  • Server #69:玩家属性同步协议

本次范围

  • 增加 Unity 侧 AttributeType 或协议生成后的等价类型映射。
  • 增加玩家属性缓存模型,例如 PlayerAttributeModel / AttributeStore
  • 属性值使用 long 或协议生成等价整数类型保存,不使用 float 作为核心存储。
  • 缺失属性默认按 0 读取。

不在本次范围

  • 不接网络消息。
  • 不做 UI 展示。
  • 不做客户端预测或本地战斗计算。

验收标准

  • Unity 侧属性类型与服务端协议可一一映射。
  • 本地缓存支持快照覆盖和单项更新。
  • 缺失属性读取结果稳定为 0 或设计文档约定值。
  • 有最小测试、Editor 校验或可运行 self-check 覆盖快照覆盖和单项更新。

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions