oakmound/oak

Init can not propagate a SceneResult

Closed this issue · 1 comments

When transitioning between scenes oak passes a sceneresult for communication between scenes without using globals. Init or some allegory should support a "sceneResult" to push into the loading scene and have propagated through to the first scene.

This is a kind of odd situation and one that I am not entirely sure should be supported but I think does ultimately make sense. That being said I think it may be a different Method than Init as changing the signature of Init itself would make starting easy examples less approachable (and be a breaking change toboot!).

Value Prop:
In some instances there may be scenes that want to validate certain types of data were set before allowing a successful transition. This can be used to have validation within the package or scene that will be operating on the data which is a nice way to keep variables and checks close to where they are used.
However in a debug situation one may want to skip to a scene quickly such as a sub game or room straight at load time. In these situations it would be great to be able to pass some struct into the command line and have it passed cleanly through.
While it is not impossible to support this with oak as is the fashion in which one would implement it is much nastier.

200sc commented

Available in v3.0.0-alpha.1 via the FirstSceneInput field on oak.Controller