Skip to content

Editor crashes when clicking play #321

Description

@PaperPrototype

Click play and it will crash the editor https://github.com/PaperPrototype/ProwlVoxels/tree/crashed-on-play-mode

Initialization complete
Compiling shader pass UI with keywords: 
Loaded fallback font: Prowl.Editor.Resources.fa-regular-400.ttf (63952 bytes)
Loaded fallback font: Prowl.Editor.Resources.fa-solid-900.ttf (394628 bytes)
EditorRegistries: 9 custom editors, 33 property editors, 10 asset editors, 14 importers, 6 thumbnail generators, 8 settings.
VAO: [ID 0] Mesh uploaded successfully to VRAM (GPU)
Compiling shader pass BlurDown with keywords: HAS_UV;
Compiling shader pass BlurUp with keywords: HAS_UV;
Opened project: VoxelPlanets at /Users/abdiellopez/Documents/Prowl Projects/VoxelPlanets
Loaded 17 entries from metadata cache.
Importing 12 assets...
[AssetDatabase] Importing 'Scripts/Cube.cs' via ScriptImporter
[AssetDatabase] Importing 'Scripts/OptimizedChunk.cs' via ScriptImporter
[AssetDatabase] Importing 'Scripts/SimpleQuad.cs' via ScriptImporter
[AssetDatabase] Importing 'Scripts/Quad.cs' via ScriptImporter
[AssetDatabase] Importing 'Scripts/CharacterInput.cs' via ScriptImporter
[AssetDatabase] Importing 'PlainComponent.cs' via ScriptImporter
[AssetDatabase] Importing 'Scripts/CameraController.cs' via ScriptImporter
[AssetDatabase] Importing 'Scripts/Noise/README.md' via DefaultImporter
[AssetDatabase] Importing 'Scripts/World.cs' via ScriptImporter
[AssetDatabase] Importing 'Scripts/Chunk.cs' via ScriptImporter
[AssetDatabase] Importing 'Scripts/Noise/FastNoiseLite.cs' via ScriptImporter
[AssetDatabase] Importing 'Scripts/VoxelTables.cs' via ScriptImporter
Import complete: 0/12 succeeded.
Asset database initialized: 17 assets tracked.
[ScriptAssemblyManager] Loaded VoxelPlanets.Game assembly: VoxelPlanets.Game.dll
EditorRegistries: 9 custom editors, 33 property editors, 10 asset editors, 14 importers, 6 thumbnail generators, 8 settings.
Loaded settings: General
Loaded settings: Editor
Loaded settings: Tags & Layers
Loaded settings: Physics
Loaded settings: Time
Loaded settings: Audio
Loaded settings: Assets
Loaded settings: Build
Opened scene: Again2.scene
VAO: [ID 0] Mesh uploaded successfully to VRAM (GPU)
[Clay] [Warning] [ObjFormat] OBJ references mtllib 'cube.mtl' but no source path is set; materials may be missing.
Compiling shader pass StandardShadow with keywords: HAS_NORMALS;HAS_TANGENTS;HAS_UV;HAS_UV2;
VAO: [ID 0] Mesh uploaded successfully to VRAM (GPU)
VAO: [ID 0] Mesh uploaded successfully to VRAM (GPU)
Compiling shader pass Prepass with keywords: HAS_NORMALS;HAS_TANGENTS;HAS_UV;HAS_UV2;
VAO: [ID 0] Mesh uploaded successfully to VRAM (GPU)
Compiling shader pass Skybox with keywords: HAS_NORMALS;
Compiling shader pass Standard with keywords: HAS_NORMALS;HAS_TANGENTS;HAS_UV;HAS_UV2;
Compiling shader pass Tonemapper with keywords: TONEMAP_AGX;HAS_UV;
Compiling shader pass Gizmos with keywords: HAS_UV;
Compiling shader pass DefaultText with keywords: HAS_UV;HAS_COLORS;
Entered play mode.
VAO: [ID 0] Mesh uploaded successfully to VRAM (GPU)
Compiling shader pass UI with keywords: 
An exception occurred during the Update loop:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at Prowl.Runtime.GameObject.GetComponentsInChildren(Type type, Boolean includeSelf, Boolean includeInactive)+MoveNext() in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/GameObject/GameObject.cs:line 925
   at Prowl.Runtime.GameObject.GetComponentsInChildren(Type type, Boolean includeSelf, Boolean includeInactive)+MoveNext()
   at System.Linq.Enumerable.CastIterator[TResult](IEnumerable source)+MoveNext()
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Enumerable.IEnumerableWhereIterator`1.ToArray()
   at Prowl.Editor.GUI.Panels.GameViewPanel.DrawGameView(Paper paper, FontFile font, Single width, Single height)
   at Prowl.Editor.GUI.Panels.GameViewPanel.OnGUI(Paper paper, Single width, Single height) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Editor/GUI/Panels/GameViewPanel.cs:line 65
   at Prowl.OrigamiUI.DockSpace.DrawLeaf(Paper paper, DockNode node, Single x, Single y, Single w, Single h, FloatingWindow fw, OrigamiTheme theme, OrigamiMetrics m, OrigamiIcons icons, FontFile font)
   at Prowl.OrigamiUI.DockSpace.DrawNodeTree(Paper paper, DockNode node, DockNode parent, Single x, Single y, Single w, Single h, FloatingWindow fw, OrigamiTheme theme, OrigamiMetrics m, OrigamiIcons icons, FontFile font)
   at Prowl.OrigamiUI.DockSpace.Draw(Paper paper, Single x, Single y, Single w, Single h)
   at Prowl.Editor.Core.EditorApplication.BeginGui(Paper paper) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Editor/Core/EditorApplication.cs:line 500
   at Prowl.Runtime.Game.<>c__DisplayClass12_0.<Run>b__2(Single delta) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/Game.cs:line 165
Unhandled exception. System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at Prowl.Runtime.GameObject.GetComponentsInChildren(Type type, Boolean includeSelf, Boolean includeInactive)+MoveNext() in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/GameObject/GameObject.cs:line 925
   at Prowl.Runtime.GameObject.GetComponentsInChildren(Type type, Boolean includeSelf, Boolean includeInactive)+MoveNext()
   at System.Linq.Enumerable.CastIterator[TResult](IEnumerable source)+MoveNext()
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Enumerable.IEnumerableWhereIterator`1.ToArray()
   at Prowl.Editor.GUI.Panels.GameViewPanel.DrawGameView(Paper paper, FontFile font, Single width, Single height)
   at Prowl.Editor.GUI.Panels.GameViewPanel.OnGUI(Paper paper, Single width, Single height) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Editor/GUI/Panels/GameViewPanel.cs:line 65
   at Prowl.OrigamiUI.DockSpace.DrawLeaf(Paper paper, DockNode node, Single x, Single y, Single w, Single h, FloatingWindow fw, OrigamiTheme theme, OrigamiMetrics m, OrigamiIcons icons, FontFile font)
   at Prowl.OrigamiUI.DockSpace.DrawNodeTree(Paper paper, DockNode node, DockNode parent, Single x, Single y, Single w, Single h, FloatingWindow fw, OrigamiTheme theme, OrigamiMetrics m, OrigamiIcons icons, FontFile font)
   at Prowl.OrigamiUI.DockSpace.Draw(Paper paper, Single x, Single y, Single w, Single h)
   at Prowl.Editor.Core.EditorApplication.BeginGui(Paper paper) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Editor/Core/EditorApplication.cs:line 500
   at Prowl.Runtime.Game.<>c__DisplayClass12_0.<Run>b__2(Single delta) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/Game.cs:line 165
   at Prowl.Runtime.Window.MainLoop() in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/Window.cs:line 220
   at Prowl.Runtime.Window.Start() in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/Window.cs:line 197
   at Prowl.Runtime.Game.Run(String title, Int32 width, Int32 height) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/Game.cs:line 219
   at Prowl.Editor.Program.Main(String[] args) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Editor/Program.cs:line 124
Unhandled exception. System.ObjectDisposedException: 'Again2' (Scene) was already disposed when 'Add' was accessed. If this asset should stay loaded, hold it via AssetRef<T> (read .Res, or call .Touch()) instead of a raw field, or use AssetDatabase.LockToScene/LockPermanent for something that must survive being unused for a while.
Object name: 'Again2'.
   at Prowl.Runtime.EngineObject.EnsureNotDisposed(String member) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/EngineObject.cs:line 83
   at Prowl.Runtime.Resources.Scene.Add(GameObject obj) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/Resources/Scene.cs:line 361
   at Voxels.World.LoadChunk(Int2 chunkPos)
   at Voxels.World.Update()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__124_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
Unhandled exception. System.ObjectDisposedException: 'Again2' (Scene) was already disposed when 'Add' was accessed. If this asset should stay loaded, hold it via AssetRef<T> (read .Res, or call .Touch()) instead of a raw field, or use AssetDatabase.LockToScene/LockPermanent for something that must survive being unused for a while.
Object name: 'Again2'.
   at Prowl.Runtime.EngineObject.EnsureNotDisposed(String member) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/EngineObject.cs:line 83
   at Prowl.Runtime.Resources.Scene.Add(GameObject obj) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/Resources/Scene.cs:line 361
   at Voxels.World.LoadChunk(Int2 chunkPos)
   at Voxels.World.Update()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__124_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()Unhandled exception. System.ObjectDisposedException: 'Again2' (Scene) was already disposed when 'Add' was accessed. If this asset should stay loaded, hold it via AssetRef<T> (read .Res, or call .Touch()) instead of a raw field, or use AssetDatabase.LockToScene/LockPermanent for something that must survive being unused for a while.
Object name: 'Again2'.
   at Prowl.Runtime.EngineObject.EnsureNotDisposed(String member) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/EngineObject.cs:line 83
   at Prowl.Runtime.Resources.Scene.Add(GameObject obj) in /Users/abdiellopez/Developer/Prowl_and_CSharp_Projects/Prowl/Prowl.Runtime/Resources/Scene.cs:line 361
   at Voxels.World.LoadChunk(Int2 chunkPos)
   at Voxels.World.Update()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__124_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

zsh: abort      ./Build/Editor/Release/net10.0/Prowl.Editor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions