Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

If you have any questions, reports, suggestions, or requests about Live2D, please send them to this forum.
※We cannot guarantee statements or answers from Live2D staff. Thank you for your understanding in advance.
 
Live2D Cubism
Cubism Products and Downloads
Cubism product manuals and tutorials
Cubism Editor Manual    Cubism Editor Tutorial    Cubism SDK Manual    Cubism SDK Tutorial
[INFORMATION](03/28/2024)
Cubism Editor 5.1 alpha version is now available!
Find out how to use the new features here.
Please take this opportunity to use it and give us your feedback!

For more information and download, please check out the Cubism Editor 5.1 alpha category.

Unloading model

edited December 2023 in Help
Hello!
Is it possible to unload model assets after destroying gameobject with LAppModelProxy attached?
I working on visual novel game with multiple characters and really want to control used memory to keep system requirements as low as possible. I noticed that model meshes remains and memory after destroying live2d model gameobject. Resources.UnloadUnusedAssets() do the job but causes lag spike in profiler so I am trying to figure out more effective way to unload unused live2d meshes.

Comments

  • Found a way to do this.
    Added this code to LAppModel.cs

    public void OnDestroy() { GetLive2DModelUnity().releaseModel(); }

    and this code to LAppModelProxy.cs

    void OnDestroy() { model.OnDestroy(); }

    Now all live2d meshes unloads form memory after destroying GameObject with LAppModelProxe.cs attached.
Sign In or Register to comment.