magique
Full Member
 
Posts: 194
Posts: 194
|
Post by magique on Feb 1, 2018 18:57:19 GMT
Ok, then obviously I won't be able to fix it. Sorry. I just have to get the game done and if I can get past it by just commenting it out then I have to go with that because it might take a lot more time to put together a test scene and all that. But it should be easily reproducible. I just have a Pooled item that has a few child components with Killable on them that aren't pooled. Then I have a spawner that spawns the main object that's pooled. As soon as it spawns it, then the warnings occur. That should be easy to reproduce.
|
|
|
Post by DarkTonic Dev on Feb 1, 2018 19:05:35 GMT
Why don't you do this. Add this debug statement to PoolBoss.cs in this existing method:
public static void RegisterPotentialInScenePoolable(PoolableInfo poolable) { if (_potentialInSceneObjects.ContainsKey(poolable)) { return; }
Debug.Log ("registering: " + poolable.name); // add this
_potentialInSceneObjects.Add(poolable, null); }
Then it will show what object is telling Pool Boss "register me". I think it's there and you just can't find it for some reason. This should happen just before the warnings you saw.
I don't understand your setup, it's a bit complex.
|
|
magique
Full Member
 
Posts: 194
Posts: 194
|
Post by magique on Feb 1, 2018 19:07:00 GMT
Won't this just show the names of the same objects already reporting in the warning messages? Or are you expecting something else to be reported?
|
|
|
Post by DarkTonic Dev on Feb 1, 2018 19:08:00 GMT
And if it does, then there is in fact a Poolable Info script on either:
1) Something that shouldn't have it (sub-game object)
or
2) Something not set up in Pool Boss.
|
|
magique
Full Member
 
Posts: 194
Posts: 194
|
Post by magique on Feb 1, 2018 19:08:56 GMT
OK, I'll give it a try tonight.
|
|
|
Post by DarkTonic Dev on Feb 1, 2018 19:12:51 GMT
Cool.
|
|
magique
Full Member
 
Posts: 194
Posts: 194
|
Post by magique on Feb 2, 2018 15:23:18 GMT
I think I'm starting to see the problem. Maybe 2 problems. I put that debug in as you suggest and it shows those child items as expected. If I pause the game look at those items in the hierarchy, they have PoolableInfo on them. However, I check the prefabs when the game is not running and I guarantee that they don't have them on there. So, Core GameKit must be adding those components.
Second, are only objects that are already in the scene supposed to have PoolableInfo on them? If so, then there is another problem because all my other objects have PoolableInfo on them and I never added it. I create them in a prototyping scene and drag them as prefabs. So, possibly that the system is adding PoolableInfo on them automatically because I created them in a scene initially?
|
|
magique
Full Member
 
Posts: 194
Posts: 194
|
Post by magique on Feb 2, 2018 15:32:17 GMT
I tried an experiment and removed the PoolableInfo script from about a dozen prefabs in my Prefabs folder. After clicking Run and PoolBoss makes clones, the PoolableInfo script is back on the prefabs in my Prefab folder. Even after stopping the game, the prefabs have been modified and now have the PoolableInfo script on them. Is that supposed to happen?
|
|
|
Post by DarkTonic Dev on Feb 2, 2018 17:02:04 GMT
Everything that's in the Scene should have PoolableInfo, and also Pool Boss will add it to the prefab when you put it into Pool Boss.
So if your sub-prefabs were ever in Pool Boss, it will have that script and you'll need to remove it.
Otherwise Pool Boss should not be modifying the prefabs.
Not sure I understand what the problem is for you right now?
|
|
magique
Full Member
 
Posts: 194
Posts: 194
|
Post by magique on Feb 2, 2018 18:07:45 GMT
So, it's a problem as I see it. If I create an object in a prototyping scene and make it a prefab and then add to PoolBoss, it then decides it needs PoolableInfo added to them. But these prefabs are not going to be in the game scene prior to being spawned so they shouldn't have PoolabeInfo on them. If I remove PoolabeInfo from them then PoolBoss adds it back in when I run the scene. As far as the sub-prefabs, I did at one time add them to PoolBoss just to see if I could get the warning to go away, but that was well after I reported the original issue to you. They were not previously added to PoolBoss.
If I understand correctly, I should be able to remove PoolableInfo from my prefabs and when I run the scene PoolBoss should not be modifying those prefabs and adding PoolableInfo on them. But it is.
|
|
|
Post by DarkTonic Dev on Feb 2, 2018 19:16:48 GMT
I don't think it's a problem, but here's how it should be working. The first part is true (if you add it to Pool Boss it will get the PoolableInfo script).
You are saying "if I remove PoolableInfo" - let's be clear here. You need to do that after you take it out of Pool Boss, and it would be wise to remove it from the prefab, or from one in-Scene copy, and click apply.
Pool Boss only adds PoolableInfo to the top-level game object of each prefab configured there, not to children game objects. If you're seeing something different, make very sure of how to do it and let me know.
|
|
magique
Full Member
 
Posts: 194
Posts: 194
|
Post by magique on Feb 2, 2018 19:22:49 GMT
OK, so I have to remove all objects from PoolBoss and re-add them? OK, I'll give that a try tonight.
|
|
|
Post by DarkTonic Dev on Feb 2, 2018 19:26:43 GMT
No, not at all. That won't fix anything. Your sub-game objects have that script on them (PoolableInfo). You need to remove it from them at the prefab level. How it got there in there first place I only can guess that you put it as a top-level prefab in Pool Boss as some point and it got the script and you didn't notice. And then you added that as a sub-game object on other things in Pool Boss later.
|
|
magique
Full Member
 
Posts: 194
Posts: 194
|
Post by magique on Feb 2, 2018 19:30:29 GMT
I think your missing something or I am. Although the sub-game object is a problem, I'm talking more now about other pooled objects. Every single one of my Pooled objects has PoolableInfo on them. If I remove that script then they get re-added at runtime, including updating the prefab itself. So, forget about sub-game objects for a moment and just look at that scenario. I assume PoolableInfo shouldn't be on those objects at all and certainly not added at runtime by PoolBoss. So, if I remove the PoolableInfo script from the prefabs then remove those prefabs from PoolBoss and re-add them then will they remain removed?
|
|
|
Post by DarkTonic Dev on Feb 2, 2018 19:39:08 GMT
Pretty sure you assume wrong.
Why is that a problem? Every top-level game object in Pool Boss is supposed to have that and gets it at runtime if it doesn't, at the prefab level. As well as everything in the Scene that's "pre-spawned". That does not cause any problem and in fact is beneficial for performance. The problem you originally reported was because a sub-game object had the script, and should not if it can't be spawned by itself.
|
|