[LayaAir3]资源未清理干净
1. 新建一个Prefab,添加图片节点,并设置“关闭时释放资源”
2. 在场景中动态添加这个Prefab
3. 关闭这个Prefab,并调用Laya.Scene.gc()
4. 打印发关,Prefab中的图片资源还在。
log:
open
--------------------------------close-----------------------------------
loader http://localhost:18090/_cache_ ... 65.ls (2) [5, PrefabImpl]
loader http://localhost:18090/resources/Box.lh (2) [5, PrefabImpl]
loader http://localhost:18090/resources/chest_bg.png (4) [6, Texture, 7, Texture2D]
loader http://localhost:18090/atlas/comp/img_bg.png (4) [6, Texture, 7, Texture2D]
close
--------------------------------gc 6000-----------------------------------
loader http://localhost:18090/resources/chest_bg.png (2) [6, Texture]
loader http://localhost:18090/atlas/comp/img_bg.png (2) [6, Texture]
2. 在场景中动态添加这个Prefab
3. 关闭这个Prefab,并调用Laya.Scene.gc()
4. 打印发关,Prefab中的图片资源还在。
log:
open
--------------------------------close-----------------------------------
loader http://localhost:18090/_cache_ ... 65.ls (2) [5, PrefabImpl]
loader http://localhost:18090/resources/Box.lh (2) [5, PrefabImpl]
loader http://localhost:18090/resources/chest_bg.png (4) [6, Texture, 7, Texture2D]
loader http://localhost:18090/atlas/comp/img_bg.png (4) [6, Texture, 7, Texture2D]
close
--------------------------------gc 6000-----------------------------------
loader http://localhost:18090/resources/chest_bg.png (2) [6, Texture]
loader http://localhost:18090/atlas/comp/img_bg.png (2) [6, Texture]
没有找到相关结果
已邀请:
2 个回复
layabox
赞同来自:
codetypes
赞同来自: