mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-31 02:32:53 +08:00
chore: remove all components with missing script (#404)
* chore: remove all components with missing script * Traverse disabled gameobjects when purging missing scripts Co-authored-by: bd_ <bd_@nadena.dev>
This commit is contained in:
parent
6591f35a78
commit
39da3b6742
@ -171,6 +171,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
AssetDatabase.StartAssetEditing();
|
||||
nowProcessing = true;
|
||||
|
||||
RemoveMissingScriptComponents(avatarGameObject);
|
||||
|
||||
ClearEditorOnlyTagComponents(avatarGameObject.transform);
|
||||
|
||||
BoneDatabase.ResetBones();
|
||||
@ -296,6 +298,12 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
Debug.Log($"Processed avatar " + avatarGameObject.name + " in " + sw.ElapsedMilliseconds + "ms");
|
||||
}
|
||||
|
||||
private static void RemoveMissingScriptComponents(GameObject avatarGameObject)
|
||||
{
|
||||
foreach (var child in avatarGameObject.GetComponentsInChildren<Transform>(true))
|
||||
GameObjectUtility.RemoveMonoBehavioursWithMissingScript(child.gameObject);
|
||||
}
|
||||
|
||||
private static void ClearEditorOnlyTagComponents(Transform obj)
|
||||
{
|
||||
// EditorOnly objects can be used for multiple purposes - users might want a camera rig to be available in
|
||||
|
Loading…
Reference in New Issue
Block a user