/// <summary> /// ///////////////// /// </summary> private void OnLoadDataTableSuccess(object sender, GameEventArgs e) { // 获取框架数据表组件 DataTableComponent DataTable = UnityGameFramework.Runtime.GameEntry.GetComponent <DataTableComponent>(); // 获得数据表 GameFramework.DataTable.IDataTable <ConfigHero> table = DataTable.GetDataTable <ConfigHero>(); // 获得所有行 ConfigHero[] rows = table.GetAllDataRows(); Log.Debug("ConfigHeros:" + rows.Length); if (table != null) { // 根据行号获得某一行 ConfigHero row = table.GetDataRow(1); // 或直接使用 dtScene[1] // 此行存在,可以获取内容了 string name = table.Name; int hp = row.Hp; Log.Debug("name:" + name + ", hp:" + hp); } else { // 此行不存在 } // 获得满足条件的所有行 ConfigHero[] drScenesWithCondition = table.GetAllDataRows(x => x.Id > 0); // 获得满足条件的第一行 ConfigHero drSceneWithCondition = table.GetDataRow(x => x.Name == "mutou"); }
static StackObject *get_Count_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); GameFramework.DataTable.IDataTable <Game.Runtime.DRAsteroid> instance_of_this_method = (GameFramework.DataTable.IDataTable <Game.Runtime.DRAsteroid>) typeof(GameFramework.DataTable.IDataTable <Game.Runtime.DRAsteroid>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.Count; __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return(__ret + 1); }
static StackObject *GetDataRow_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @id = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); GameFramework.DataTable.IDataTable <Trinity.DRScene> instance_of_this_method = (GameFramework.DataTable.IDataTable <Trinity.DRScene>) typeof(GameFramework.DataTable.IDataTable <Trinity.DRScene>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.GetDataRow(@id); return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }
static StackObject *GetDataRow_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj) { ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject *ptr_of_this_method; StackObject *__ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @id = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); GameFramework.DataTable.IDataTable <Game.Runtime.DRWeapon> instance_of_this_method = (GameFramework.DataTable.IDataTable <Game.Runtime.DRWeapon>) typeof(GameFramework.DataTable.IDataTable <Game.Runtime.DRWeapon>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); __intp.Free(ptr_of_this_method); var result_of_this_method = instance_of_this_method.GetDataRow(@id); object obj_result_of_this_method = result_of_this_method; if (obj_result_of_this_method is CrossBindingAdaptorType) { return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance)); } return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method)); }