优化
Merlin-Ice
Write the best codes for the best game!
展开
-
Unity il2cpp LinuxInterop_dlopen Error
解决Unity il2cpp 编译Bug问题原创 2022-11-26 16:10:02 · 499 阅读 · 0 评论 -
Unity 模块化编程
再Unity 2020版本中提供了创建Assembly definitions资源的功能 模块化步骤: 模块化只帧对当前文件夹目录下的代码 1、在代码目录下创建Assembly definition资源,命名为T1 对T1属性进行设置: 在这里插入图片描述 打开工程即可看到 2、在子目录Behavior中再建立一个模块T2, 再Behavior目录下再创建一个Assembly definition资源,命名为T2 其属性和T1配置相同 然后打开工程: ...原创 2022-02-25 16:35:36 · 5497 阅读 · 0 评论 -
Texture Atlas 一图多用
资源: 最终效果 代码: Shader "Custom/TextureID" { Properties{ _MainTex("Base (RGB)", 2D) = "white" {} } SubShader{ Tags { "RenderType" = "Opaque" } LOD 300 Pass { Tags { "LightMode" = "Verte原创 2021-04-20 21:37:49 · 530 阅读 · 0 评论 -
C# GC
WeakReference 用在内存占用比较大的上面,short:当回收时引用为空,long,当回收时保留引用,不过其Target已经被清理 Class Object 清理后必须赋null,只有这样才能释放,最后才会调用析构函数 Dispoe需要继承IDispose,而且只用于有非托管数据时数据清理工作 Dispose和析构不在同一时间序列中执行。 GC触发: 用户调用、堆内存过大、管理内存堆threshold不够 在GC时,所有线程都会被suspend,直到GC完全执行完毕 什么时候Threshold增加原创 2021-04-07 21:20:17 · 141 阅读 · 0 评论