
C#
fw_wyc
这个作者很懒,什么都没留下…
展开
-
Addressables创建回调
///加载回调GameObject tempPanel = null;//回调方法1Addressables.InstantiateAsync(panelName.ToString() + "Panel", CanvasTransform).Completed += OnCompleted;//回调方法2Addressables.InstantiateAsync(panelName.ToString() + "Panel").Completed += (handle) =>{ i.原创 2021-10-23 19:47:22 · 515 阅读 · 0 评论 -
Mono.Data.Sqlite 连接关闭后文件占用解决方法
关闭后手动GCif (SqlConnection != null){ SqlConnection.Close(); SqlConnection = null;}GC.Collect();原创 2021-08-22 15:56:25 · 486 阅读 · 0 评论 -
c# 泛型单例 Exception: 没有找到类型:*的无参私有构造函数! 解决方案
参考:https://blog.youkuaiyun.com/u014234721/article/details/86524550报错原因,子类没有定义私有的构造函数,我这边是因为写成了共有的构造函数原创 2021-03-24 23:46:43 · 278 阅读 · 0 评论 -
excelReader.GetString(i)报错解决
excelReader.GetString(i)报错因为表里的数据是其他类型,比如int,所以直接获取会报错可以改成Convert.ToString(excelReader.GetValue(i)原创 2021-03-23 22:46:43 · 343 阅读 · 0 评论 -
根据字符串来转换成类型,传入同时调用泛型方法
Type type = Type.GetType("命名空间.类型");MethodInfo mi = typeof(泛型方法所在的类(非泛型类)).GetMethod("泛型方法名");object[] invokeArgs = new object[] { 泛型方法参数1,泛型方法参数2,...};mi.MakeGenericMethod(new Type[] { type }).In...原创 2019-10-07 22:57:58 · 730 阅读 · 0 评论