This class provides functionality to instantiate prefabs, keep track of multiple instances, and destroy them either immediately or after a delay. It also includes event-driven notifications for when instances are destroyed.
Works with normal and addressable prefabs.
To use custom types as a key, you'll need to create a new class that implements one of these abstract classes.
A version that uses string as a key is already implemented.
Why bother writing custom editor?
So you don't have to manually attach everytime you make a change. You can do it all with one click.
Normal Prefabs
Search in folder. Base class name: PrefabLoaderClassic
Addressable prefabs
Search assets with label. Base class name: PrefabLoaderAddressable
You can copy these steps if you want to create other custom types.
PrefabLoaderClassicString and PrefabLoaderAddressableString
Step 1: Create Your Class
// Normal PrefabspublicabstractclassPrefabLoaderClassicString:PrefabLoaderClassic<string>{}// Addressable PrefabspublicabstractclassPrefabLoaderAddressableString:PrefabLoaderAddressable<string>{}