(05-15-2023, 12:40 PM)_Aka_ Wrote: 2- If Pooled objects implement FluffyUnderware.DevTools.IPoolable, their OnBeforePush and OnAfterPop are called. Take a look on that interface and its usage to better understand how that works. You can use that interface's methods to make any code execute when reusing pooled objects
I tried setting my objects to use that interface and it didn't call the methods. Am I supposed to make a custom UnityObjectPool or something?
Edit* Yeah sadly unless I'm missing something, getting access to my scripts doesn't seem as straight forward as Id like. It seems like I need to make a custom pool, then make custom modules for the generator.
Unless I'm mistaken and there is a simpler way...
All I'm trying to do is generate my own scripted prefab walls, call an initialization on creation, and have access to them right after. This way I can do things like call a preview script.
As of now I'm using a modified generator that uses createGameObject. This unfortinately doesn't give me any direct access to my scripts. Instead needing me to loop through all the objects and grab the component.
But this also has issues due to the order. I'm unable to accurately get most current generated objects to apply things. Instead I get a mix of old/new.