Dictionary <string, AttributeSingleData> baseAndEquipAttData = new Dictionary <string, AttributeSingleData>(); //装备+基础,为了某些BUFF可以影响到装备和基础 //初始化所有属性,单位的属性从文件中读取后写入这里 public AttributeData(UnitData unitData) { AttributeKeys attkeys = JsonFileDeal <AttributeKeys> .ReadJsonFile("AttributeKey"); if (attkeys == null) { Debug.LogError("没读取到AttributeKey文件"); return; } for (int i = 0; i < attkeys.singleKeys.Count; i++) { CreateDic(unitAttData, attkeys.singleKeys[i]); CreateDic(equipAttData, attkeys.singleKeys[i]); CreateDic(buffAttData, attkeys.singleKeys[i]); CreateDic(baseAttData, attkeys.singleKeys[i]); CreateDic(baseAndEquipAttData, attkeys.singleKeys[i]); } //加载基础属性(未实现,需读取文件) //Debug.Log(baseAttData.Count); //foreach(var item in baseAttData) //{ // Debug.Log(item.Value.attName + " " + item.Value.maxValue); //} }
public Keyboard() { SkillKeycodeKey loadedKeys = JsonFileDeal <SkillKeycodeKey> .ReadJsonFile("SkillKeycodeKey"); if (loadedKeys == null) { CreateDefaultKey(); } else { for (int i = 0; i < loadedKeys.skillKeys.Count; i++) { CreateKeyBoardData(loadedKeys.skillKeys[i].skillID, loadedKeys.skillKeys[i].keyCode, loadedKeys.skillKeys[i].keyCodeType); } } }