LogicalError / realtime-CSG-for-unity

Realtime-CSG, CSG level editor for Unity
https://realtimecsg.com
MIT License
783 stars 82 forks source link

Cannot make a build due to CSGSceneManagerInstance errors #228

Closed VergilUa closed 6 years ago

VergilUa commented 6 years ago

I've got some models in the scene, this is what I get when I try to build it: Destroying object multiple times. Don't use DestroyImmediate on the same object in OnDisable or OnDestroy. UnityEngine.Object:DestroyImmediate(Object) InternalRealtimeCSG.CSGSceneManagerInstance:DestroyExportedModel(CSGModelExported, Boolean) (at Assets/Plugins/RealtimeCSG/Editor/Scripts/Managers/CSGSceneManagerInstance.cs:70) InternalRealtimeCSG.CSGModelExported:DestroyModel(Boolean) (at Assets/Plugins/RealtimeCSG/Runtime/Scripts/Components/CSGModelExported.cs:47) InternalRealtimeCSG.CSGModelExported:OnDestroy() (at Assets/Plugins/RealtimeCSG/Runtime/Scripts/Components/CSGModelExported.cs:38) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

Version of Unity - 2017.3.0f3, RealtimeCSG v1.509 for 2017.3

LogicalError commented 6 years ago

Thanks for reporting, I'll take a look at it first thing when I can

LogicalError commented 6 years ago

Hi, I took a quick look and I'm a bit confused by your bug report because it says the error is on line 167 in the file CSGSceneManagerInstance.cs .. but in the 1.509 package the file has 83 lines? Can you send me your CSGSceneManagerInstance.cs file? (you can find an email address in the top right corner of https://realtimecsg.com/ ) Not sure what happened there

VergilUa commented 6 years ago

Woops, my bad, posted wrong line number (used code formatting before it), correct one is 70. Fixed in first post too.

VergilUa commented 6 years ago

Ok, so I think I've understood why it's happening. I've had some prefab in the scene that had disabled CSGModel component with CSGModelExported component attached to it. Once I've pressed the "remove hidden model" button, error went away and I was able to successfully make a build.

Still a strange behaviour.

LogicalError commented 6 years ago

This is issue should be fixed in 1.510 I'll close this ticket once it arrives on the asset store, in the mean time you can download it here: https://realtimecsg.com/updates/