mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-03-09 23:34:56 +08:00
Fix attempted destruction of constraint assets
This commit is contained in:
parent
78e2d2516a
commit
d5956d6d2d
@ -22,6 +22,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using VRC.SDKBase.Editor.BuildPipeline;
|
using VRC.SDKBase.Editor.BuildPipeline;
|
||||||
|
|
||||||
@ -37,7 +38,10 @@ namespace net.fushizen.modular_avatar.core.editor
|
|||||||
|
|
||||||
foreach (var proxy in boneProxies)
|
foreach (var proxy in boneProxies)
|
||||||
{
|
{
|
||||||
if (proxy.constraint != null) UnityEngine.Object.DestroyImmediate(proxy.constraint);
|
if (proxy.constraint != null && proxy.constraint.gameObject == proxy.gameObject)
|
||||||
|
{
|
||||||
|
UnityEngine.Object.DestroyImmediate(proxy.constraint);
|
||||||
|
}
|
||||||
if (proxy.target != null)
|
if (proxy.target != null)
|
||||||
{
|
{
|
||||||
var oldPath = RuntimeUtil.AvatarRootPath(proxy.gameObject);
|
var oldPath = RuntimeUtil.AvatarRootPath(proxy.gameObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user