umasteeringgroup / UMA

Unity Multipurpose Avatar
MIT License
726 stars 167 forks source link

Deleting its own prefabs at random? #366

Closed peacemakers109 closed 2 years ago

peacemakers109 commented 2 years ago

Version 2.12, Unity Version 2020.3.12f1 So I have a new project, and have Mirror, and UMA in it to play with since never used it before Made a new scene, added the UMA Dynamic Character, and the UMA GLIB Prefabs then added in some UI stuff for editing chars, and the script to manage the ui controls. Sometimes when I Play in editor, it just stops working and looking threw everything I noticed sometimes the UMA_GLib prefab just 'vanishes' from the scene. Nothing in the scripts I wrote effect anything for Adding or removing from a scene any components or otherwise, so I am not sure why it just vanishes. The only added things is the ui controller, and all it does is look for changes on the slider bars, then assigns the dna, and generats. I have a long UI Controller since I added all the Dna stuff to its own methods, but a example method is

   private void Updated(UMAData data) // Called when the Listenders sees a Change
    {
        dna = Avatar.GetDNA();
        heightSize.value = dna["height"].Get();

} private void OnEnable() { Avatar.CharacterUpdated.AddListener(Updated); heightSize.onValueChanged.AddListener(HeightChange); }

    public void HeightChange(float val) // called each time the height slider changes
    {
        dna["height"].Set(val);
        Avatar.BuildCharacter();
    }

Is there a way to lock or prevent the GLIB from being deleted?

Jaimi commented 2 years ago

This has been fixed in my development branch.
I no longer add a "EditorContext" automatically. Instead, I prompt the user to add either a permanent copy, or a temporary copy that will last until the scene is closed. It's never deleted automatically anymore. This will appear in the next update.