Comments (5)
如果不这样改的话 需要自己调用一次 Resources.UnloadUnusedAssets(); 才会释放掉
from absystem.
另外我发现一个问题 Test.cs
GameObject go = Instantiate(a.mainObject) as GameObject;//a.Instantiate();
如果 GameObject go = Instantiate(a.mainObject) as GameObject; 这种写法好像有问题.
应该使用 后面的 a.Instantiate();
我不清楚是不是我使用的方法有问题.
from absystem.
1.首先Dispose是AssetBundleManager调用的,不要手动调用,AssetBundle.Unload(true)比较不安全,它会把所有的实例也销毁了,即使你正在使用的。
2.是的,a.mainObject尽量不要使用,使用a.Instantiate(), 这样ABSystem会对AB的引用自动管理,自动帮你卸载不用的AB
from absystem.
没有释放的问题可能你有正在使用的ab资源的实例吧,实在不行你手动调用Resources.UnloadUnusedAssets()也是可取的,但是建议不要AssetBundle.Unload(true),除非你能很明确外部已经没有任何引用它的资源存在,否则是不安全的
from absystem.
好的 我在测试一下 我感觉现在的框架AssetBundle.Unload(true)其实没有问题 一个资源被多个引用 调到AssetBundle.Unload(true)的地方只有Dispose 这个是引用计数为0的情况下才会调用的. 暂时感觉没问题提. 我会在测试测试.
感谢
from absystem.
Related Issues (20)
- 在Unity Editor5.6.4下,切换到Android平台,材质Shader为Unlit/Texture时,通过AB加载模型显示紫色 HOT 2
- 那个用AB设置图片Package Tag打包图集出现冗余 HOT 1
- 关于AssetBundleDataReader的疑问 HOT 1
- 真机上 scrollview 内的材质丢失 HOT 2
- 唐哥,问个问题,增量打包是否有必要? HOT 2
- 关于资源自动卸载 HOT 4
- 关于打Bundle的粒度 HOT 1
- 关于unity内置资源冗余问题 HOT 1
- 资源没有变化的情况下,打包assetsBundle文件有变化 HOT 2
- 关于mainAsset导致的卡顿问题 HOT 2
- 某些情况场景里的某些共用资源被重复打到场景里 HOT 2
- ios真机测试第一次运行报错 HOT 1
- AssetBundleInfo中的depChildren有什么作用呢? HOT 2
- 请问下,这个不能手动指定哪些资源打成一个ab包的吗?
- 服务器下载要怎么做呢?
- LoadMetaHashIfNecessary 只在非unity5的版本中执行? 这个是什么意思 HOT 2
- 编译错误
- Scripting Backend设置成IL2CPP Android平台下加载报错
- 您好,请问AB加载场景的策略是什么?
- 例子 在unity5.4 在windows编译成demo 运行的时候并不能正确加载到被打包的资源
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from absystem.