Retrieve Object Prefab name (699906)

Hello,
I am trying to retrieve object prefab name. I know that I can do that using:

PrefabUtility.GetPrefabParent(gameObject).name

but the problem is that it only works inside editor. I’m working on the ‘SelectionManager’ in my game and right now I want to make double click on an object and select multiple same objects method, but I first want to somehow tag all the objects so that when I double click on a curtain object it would only select objects with the same type / tag. I thought about making an enum, but getting a name is much more simple and convenient.
Are there any ways in getting the prefab name outside the editor? Also maybe it’s possible to somehow get the original gameObject name without counter tag?

Or are there any better way’s in making something like this? Thank you

Finding objects by name is very slow. If you are creating them, why not add them to a list or array?

Thank you for the response!
Yes of course, I do not find objects by name, what I do is at the start of the game I make all the objects that use selectable interface add themselves to the selectableSceneObjects list, then everytime I drag select or double click I loop through that selectableObjects list and check if object in that list is inside that rect, if it is I select this object.
But what I want is to somehow tag all these objects. I could add a name variable and then access that variable and check if the name is the same, but I’m not sure if that’s the best way tho.,

You could spawn them as the prefab type. For instance:
Instantiate(enemy) as enemy;
Then use FindObjectOfType(enemy);
or if you are cycling through and array:
if(object.typeof(enemy){}

Caveat here is I haven’t actually done this, but it should work I would think. Not sure if the syntax is right either, but it would be something like that. I have to have Visual Studio.