Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Find missing reference for selected gameobjects #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Editor/MissingReferencesFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,28 @@ public static void FindMissingReferencesEverywhere() {
// Restore the scene that was originally open when the tool was started.
if (!string.IsNullOrEmpty(currentScenePath)) EditorSceneManager.OpenScene(currentScenePath);
}

[MenuItem("Tools/Find Missing References/In selected gameObjects", true, 54)]
public static bool FindMissingReferencesInSelectedGameObjectsValidate() => Selection.gameObjects.Length != 0;

[MenuItem("Tools/Find Missing References/In selected gameObjects", false, 54)]
public static void FindMissingReferencesInSelectedGameObjects()
{
var selectedGameObjects = Selection.gameObjects;

showInitialProgressBar($"{selectedGameObjects.Length} assets");

clearConsole();

int count = 0;

foreach (var selectedGameObject in selectedGameObjects)
{
count += findMissingReferences("selected", selectedGameObject, true);
}

showFinishDialog(false, count);
}

private static bool isProjectAsset(string path) {
#if UNITY_EDITOR_OSX
Expand Down