Oshigawa
Full Member
Posts: 228
Posts: 228
|
Post by Oshigawa on Oct 16, 2017 10:14:30 GMT
Maybe it's a stupid question, but i want to check nevertheless. Are copies of the object spawned from the same item pool as the original object or they considered to be different objects? For example, Object and Object (1), Object (2), Object (3). Will the Object (1), Object (2), Object (3) spawn from Object pool item?
Edit: I see they appear in Uncategorized when spawned, so i guess not.
But i do have another question. I have a prefab named Squadron, which is just an empty object, in the pool and which contains three Ship prefab objects which are also in the pool. I spawn Squadron object, which appears with three Ship child objects. Are the Ship objects going to be spawned from the pool or instantiated?
|
|
|
Post by DarkTonic Dev on Oct 16, 2017 15:58:02 GMT
Incorrect. I have no idea what you are seeing when you say "they appear in uncategorized when spawned", but that's wrong. Items do not change category unless you change the category yourself in the Inspector.
You can see the spawned count of the item at runtime in the Inspector for "Object". If you have it set to create 5 and you spawn one, it will say "1/5 spawned". Yes they are exact copies of "Object" and are Instantiated during Awake, for later spawning.
Question#2, If your Squadron prefab has sub-game objects already attached to it, and you spawn a Squadron, it's actually just one thing (the Squadron) and you don't need to have a separate Ship prefab, because it's not used.
If your Squadron prefab is indeed empty and you spawn Ships separately, and parent them to Squadron, they will be spawned.
Nothing is *ever* Instantiated unless you check the "Auto-Add Missing Items" box (which is not good to do but is ok temporarily to see the item peaks), or if you check "Allow Instantiate More" for the item and you've already spawned all the existing copies (which is also something I never do, because Instantiating is bad).
|
|
Oshigawa
Full Member
Posts: 228
Posts: 228
|
Post by Oshigawa on Oct 17, 2017 15:30:35 GMT
I spawned the object that was not in the pool and it appeared as uncategorized in the pool boss. I might be wrong though.
Thanks for the question #2, the answer means a lot to me.
|
|
|
Post by DarkTonic Dev on Oct 17, 2017 15:36:28 GMT
How do you spawn something not in the pool?
|
|