# Variable: attributes

attributes(): Promise‹ReadonlyWithExtensions‹Attribute[]››

返回属性信息列表,例如金币、体力等,具体的属性列表跟配置有关。

example

// 导入账号模块
import { attributeSystem } from '@timi/mogs-sdk';
// ...
// 获取属性相关信息
const attributes = await attributeSystem.attributes;
attributes.forEach((attr) => {
  console.log(attr.id, attr.name, attr.value);
});
1
2
3
4
5
6
7
8

# 返回值:

Promise‹ReadonlyWithExtensions‹Attribute[]››

Attribute结构

属性 类型 描述
attributeConf? AttributeConf 属性配置信息
changeTime? Long 属性最近一次改变的时间
id number 属性 ID
value Long 属性值