You've already forked UniversalViewer
Eversoul support WIP
Updated line renderer material for handles Handle fixes Fixes
This commit is contained in:
@@ -134,4 +134,11 @@ public class CameraContainer: ObjectContainer
|
||||
|
||||
Camera.UpdateImmediate();
|
||||
}
|
||||
|
||||
public override void Destroy()
|
||||
{
|
||||
//Do not destroy cameras
|
||||
Frames.Clear();
|
||||
SetDefaultFrame();
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,8 @@ public class ObjectContainer : MonoBehaviour, IKeyframeSetter
|
||||
{
|
||||
SetKeyframe();
|
||||
}
|
||||
|
||||
ModelViewerMain.RegisterObject(this);
|
||||
}
|
||||
|
||||
public virtual void PasteContainer(ObjectContainerSerializable bones, PoseLoadOptions pasteParams)
|
||||
@@ -92,6 +94,7 @@ public class ObjectContainer : MonoBehaviour, IKeyframeSetter
|
||||
ModelViewerMain.UnregisterObject(this);
|
||||
if (gameObject != null)
|
||||
Destroy(gameObject);
|
||||
ModelViewerMain.OnObjectDeleteEvent.Invoke(this);
|
||||
Resources.UnloadUnusedAssets();
|
||||
System.GC.Collect();
|
||||
}
|
||||
@@ -234,7 +237,7 @@ public class ObjectContainer : MonoBehaviour, IKeyframeSetter
|
||||
throw new NotImplementedException(this.GetType().FullName);
|
||||
}
|
||||
|
||||
public void Destroy()
|
||||
public virtual void Destroy()
|
||||
{
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
|
||||
@@ -34,4 +34,16 @@ public class SceneContainer : ObjectContainer
|
||||
{
|
||||
return new SceneSerializable(this);
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
if (_applicationQuitting) return;
|
||||
|
||||
for (int i = AllObjects.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var obj = AllObjects[i];
|
||||
if (obj == this) continue;
|
||||
obj.Destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user