Dear Users,

Now, we are seeking users who can give us a hand with expertise to evolve our software more dynamically.
If you are willing to help us, we’d like you to make a registration for “Live2D Creators Circle” via the link below.
Designers, programmers, translators are especially welcomed so far.
(More detailed explanation will be given to you before we ask you to do tasks)

https://docs.google.com/forms/d/1G5KK_GL3ozwPXtTHrpi_ktbsI8UZf8jlYRSlDworyBo/viewform?usp=send_form

Unloading model

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.