Code Monkey home page Code Monkey logo

Comments (5)

huangkumao avatar huangkumao commented on June 6, 2024

如果不这样改的话 需要自己调用一次 Resources.UnloadUnusedAssets(); 才会释放掉

from absystem.

huangkumao avatar huangkumao commented on June 6, 2024

另外我发现一个问题 Test.cs
GameObject go = Instantiate(a.mainObject) as GameObject;//a.Instantiate();
如果 GameObject go = Instantiate(a.mainObject) as GameObject; 这种写法好像有问题.
应该使用 后面的 a.Instantiate();
我不清楚是不是我使用的方法有问题.

from absystem.

tangzx avatar tangzx commented on June 6, 2024

1.首先Dispose是AssetBundleManager调用的,不要手动调用,AssetBundle.Unload(true)比较不安全,它会把所有的实例也销毁了,即使你正在使用的。
2.是的,a.mainObject尽量不要使用,使用a.Instantiate(), 这样ABSystem会对AB的引用自动管理,自动帮你卸载不用的AB

from absystem.

tangzx avatar tangzx commented on June 6, 2024

没有释放的问题可能你有正在使用的ab资源的实例吧,实在不行你手动调用Resources.UnloadUnusedAssets()也是可取的,但是建议不要AssetBundle.Unload(true),除非你能很明确外部已经没有任何引用它的资源存在,否则是不安全的

from absystem.

huangkumao avatar huangkumao commented on June 6, 2024

好的 我在测试一下 我感觉现在的框架AssetBundle.Unload(true)其实没有问题 一个资源被多个引用 调到AssetBundle.Unload(true)的地方只有Dispose 这个是引用计数为0的情况下才会调用的. 暂时感觉没问题提. 我会在测试测试.

感谢

from absystem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.