unity-scene-reference icon indicating copy to clipboard operation
unity-scene-reference copied to clipboard

SceneReference Constructor

Open fpdotmonkey opened this issue 5 years ago • 1 comments

It'd be nice for test automation to have a constructor that took a path to a scene. Something like this.

void TestSceneThing()
{
    SceneReference scene = new SceneReference("/Assets/Scenes/TestScenes/test_scene_1.unity");
    bool weDidStuffToTheScene = thing.DoStuffTo(scene);
    Assert.That(weDidStuffToTheScene, Is.True);
}

fpdotmonkey avatar Nov 09 '20 00:11 fpdotmonkey

The SceneReference class is designed to be constructed only in the context of the inspector, therefore I see no benefit of having a meaningful constructor to be used either in runtime or in tests.

Can you elaborate more on what you are trying to test here?

starikcetin avatar Nov 09 '20 00:11 starikcetin