Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Way to get objects script from generator
#4
(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... Sad


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.
Reply


Messages In This Thread
RE: Way to get objects script from generator - by Lupos - 05-18-2023, 12:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 1 10 04-03-2024, 03:16 PM
Last Post: _Aka_
Exclamation Extending Curvy Generator for Advanced Lofting - Feasibility Check amutp 2 5 03-27-2024, 07:25 AM
Last Post: amutp
  Adjust radius of generated mesh via script? Shackman 1 4 03-26-2024, 01:12 PM
Last Post: _Aka_
  Generating GO only on CPs in Generator GameDeveloperek4123 1 7 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: