Editor script to list all of a class in the project

I’m trying to write an editor script that sets properties for components in my prefabs. It seemed like:

Object[ ] os = Selection.GetFiltered(typeof(Character),SelectionMode.DeepAssets);

Would get me the references I’d need, but the array always comes up empty. I’ve tried various combinations of selectionmode flags, but no luck. It works fine if the type is a Texture though.

I also tried Selection.GetTranforms, thinking that I could go transform.gameObject.GetComponent(typeof(Character)), but it returns an empty array too.

Longshot, but perhaps temporarily change the name of the class to XCharacter (or anything different from the original name) and try your editor script again with the new name. I’m always slilghtly dubious about names like that because there are sometimes built-in types or reserved words that can cause problems. I doubt this is the case here, but just to make sure.

Failing that, is there any chance you could post the project or a portion of it that demonstrates the problem?

I was suspicious of that, too, so I tried having it search for GameObject and some other types… but the only thing that it would find were textures or sounds.