// Start is called before the first frame update void Start() { //示例 carList = GameConfigDataBase.GetConfigDatas <CarConfigData>(); text1.text = carList[1].carName; text2.text = carList[1].description; text3.text = carList[1].beginAcc.ToString(); }
private void Start() { List <test> _test = GameConfigDataBase.GetConfigDatas <test>(); for (int i = 0; i < _test.Count; i++) { Debug.Log(_test[i].name); Debug.Log(_test[i].age); Debug.Log(_test[i].level); } btn = this.transform.Find("Button").GetComponent <Button>(); _key = this.GetComponent <BasekeyState>(); _key.registerCallBack(btn, this.test); }
public static void SerializerConfig() { GameConfigData gameConfigData = GameConfigDataBase.GetInstance().GetGameConfigData(); if (gameConfigData == null) { Debug.Log("gameConfigData is null"); return; } string detailGameConfigPath = string.Format("{0}/../conf/{1}", Application.dataPath, gameConfigData.detailGameConfigPath); string datPath = string.Format("{0}/../conf/{1}", Application.dataPath, gameConfigData.datPath); GetTargetDirAllFilePath(datPath); FunPlus.Util.CheckXML.GetInstance().LoadIgnoreFile(); GameConfigGroups gameXmlGroups; GameConfigGroups gameXmlSheetGroups; //GameConfigGroups gameXmlLevelGroups; //GameConfigDataBase.GetInstance().TryGetGroups(out gameXmlGroups, out gameXmlSheetGroups, out gameXmlLevelGroups); GameConfigDataBase.GetInstance().TryGetGroups(out gameXmlGroups, out gameXmlSheetGroups); GetAllFileByXmlGroup(gameXmlGroups); SerializeAllXml(mXmlGroups); //GetAllFileByXmlLevelGroup(gameXmlLevelGroups); //SerializeAllXml(mXmlLevelGroups); GetAllFileBySheetGroup(gameXmlSheetGroups); SerializeAllXmlSheet(mXmlSheetGroups); ConfigGroupsSettings conf = new ConfigGroupsSettings(); conf.xmlGroups = mXmlGroups.ToArray(); conf.xmlSheetGroups = mXmlSheetGroups.ToArray(); conf.xmlLevelGroups = mXmlLevelGroups.ToArray(); //删除这次生成之外的文件 DeleteNotChangePath(conf); ReplaceRelativePath(ref conf); GameConfigDataBase.GetInstance().DetailPathWriteToFile <ConfigGroupsSettings>(conf, detailGameConfigPath); }
List <CardConfig> cardConfigDatas;//技能数据 public void Init() { cardConfigDatas = GameConfigDataBase.GetConfigDatas <CardConfig>(); }
public void Init() { skillConfigDatas = GameConfigDataBase.GetConfigDatas <SkillConfig>(); }