cris
New Member
Posts: 9
Posts: 9
|
Post by cris on Feb 13, 2019 8:47:52 GMT
Hi there,
Is it possible to initialize a prefab on creation (both when the pool is being created and when a new item is allowed to be created in the pool extending its size)? I've tried instantiating the prefab, calling my Init function and then passing this initialized instance to create a new pool in PoolBoss but the pooled instances don't keep the same state and values.
Thanks!
|
|
|
Post by DarkTonic Dev on Feb 13, 2019 17:17:37 GMT
You could try putting code in Awake or Start for that prefab, but it's possible that those events won't be called until it is spawned the first time, I'm not sure. Other than that, you should be putting code in OnSpawned, which gets called every time it gets spawned.
Pooled clones aren't going to copy any values, only Instantiate another of the prefab in its base state.
|
|