Facepunch / sbox-issues

176 stars 12 forks source link

Unit tests for scenes #6486

Open MrBrax opened 1 month ago

MrBrax commented 1 month ago

For?

S&Box

What can't you do?

Can't do testing for components and systems in the scene, only for standalone code. Would be great to be able to test ingame logic.

How would you like it to work?

Like unit tests work currently but for scene stuff, maybe scene.push-like?

What have you tried?

Loading scenes did not work, it always returned weird stuff.

Additional context

No response

garrynewman commented 1 month ago

This should work already

MrBrax commented 1 month ago

What's the path for loading scenes? I've tried things like this:

var opt = new SceneLoadOptions() { };
opt.SetScene( ResourceLibrary.Get<SceneFile>( "scenes/testing.scene" ) );

or

opt.SetScene( "C:/Users/Braxen/Documents/s&box projects/farm_merge/Assets/scenes/testing.scene" );

scene.Load( opt );

But the scene directory is always empty, tried pushing scene too but it did nothing