|
Post by christougher on Aug 27, 2018 21:52:10 GMT
Hi, my main menu has a LevelWaveSettings Prefab in it set to persist between scenes. When the main menu gets loaded again a second one is created and I get the error "You have more than one LevelWaveSettings prefab in your scene. Please delete all but one. Aborting." In Master Audio it simply deletes the newly created one with no fuss. How should I best do this with CGK? Thx! Chris
|
|
|
Post by DarkTonic Dev on Aug 28, 2018 0:45:29 GMT
Use a bootstrapper scene if you want to do that. And dont put LevelSettings in the other Scenes.
If its a major pain we can add the MA behavior. Let me know.
|
|
|
Post by christougher on Aug 29, 2018 4:36:35 GMT
Part of the reason I have a copy in each scene is to be able to test each scene without having to load through the main menu first. So for development it makes sense. But then when I build I'd like it to persist to keep from having to initialize it again every scene change. I use the same exact LevelWaveSettings prefab in each scene and simply instantiating it if it's missing causes other problems. I think It would be a good feature to add.
|
|
|
Post by DarkTonic Dev on Aug 29, 2018 5:04:53 GMT
Ok, I'll put it as #1 on the roadmap since it should be pretty easy. Thanks for the feedback.
|
|
|
Post by DarkTonic Dev on Aug 29, 2018 15:45:21 GMT
I've completed this request and the next update will have it.
|
|
|
Post by christougher on Oct 3, 2018 4:37:14 GMT
Thanks for Implementing this! There seems to be a problem though. When I first load a scene with the LevelWaveSettings prefab in it everything works fine, everything spawns fine. When I change scenes and try to spawn the same prefab transform with this code:
PoolBoss.Spawn(PointerObj, nearClipPoint, rot, null);
I get this error:
The Transform 'BubbleShooter 1' passed to Spawn method is not configured in Pool Boss. UnityEngine.Debug:LogError(Object) DarkTonic.CoreGameKit.LevelSettings:LogIfNew(String, Boolean) (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/Level/LevelSettings.cs:1333) DarkTonic.CoreGameKit.PoolBoss:Spawn(Transform, Vector3, Quaternion, Transform) (at Assets/Plugins/DarkTonic/CoreGameKit/Scripts/PoolBoss/PoolBoss.cs:757) AlignToTouch:Update() (at Assets/AlignToTouch.cs:87)
|
|
|
Post by DarkTonic Dev on Oct 3, 2018 4:58:46 GMT
I got it, change the Destroy to DestroyImmediate in Awake in LevelSettings.cs
private void Awake() { var ls = FindObjectsOfType(typeof(LevelSettings)); if (ls.Length > 1) { DestroyImmediate(gameObject); return; }
|
|
|
Post by christougher on Oct 3, 2018 11:57:14 GMT
Excellent! Thanks again, this is a huge performance booster for me!
|
|
|
Post by DarkTonic Dev on Oct 3, 2018 15:37:20 GMT
No problem.
|
|