Please just let us attach script to the scene itself
It far more better to control scene like that, separate from the objects in the scene
Please stop forcing people to create useless gameobject just for holding script in the scene
Please just let us attach script to the scene itself
It far more better to control scene like that, separate from the objects in the scene
Please stop forcing people to create useless gameobject just for holding script in the scene
I think it would be cool if the “super root” of the scene could be a gameobject, and thus could have components attached. I think this is sort of along the lines of what you’re thinking
You can do that already with [RuntimeInitializeOnLoadMethod] to run any code (non-MonoBehaviours).
https://docs.unity3d.com/ScriptReference/RuntimeInitializeOnLoadMethodAttribute.html
If you need to run updates - you can use something like UniRx’s MicroCoroutines or subscribing to the Observable.EveryUpdate etc.
The con is that you cannot obviosly access data from the Editor, but that can be bypassed by using ScriptableObjects and storing data there.
@VergilUa
There was a difference about that
RuntimeInitializeOnLoadMethod
Is not a script for scene, it would be for the whole game
My feature, the Scene script, would be bind to the scene, given that the scene would be loaded or unloaded dynamically or additively. The scene itself would be control what really in the scene
I was request this feature specifically to make it be the same workflow and same experience as the existing unity system. Not just hack it around like you trying to do. I know I could do that and I have been doing that kind of hacking all along. But it should never be like that. We should just have scene script or better alternative feature. Stop trying to make a hacking be the default workflow
Problem of SuperRoot
gameobject is transform dispatch. It affect performance. If it not I would just use a root gameobject freely
Its not that useful to be honest.
If you really need that kind of a system, you can always implement it on your own.
You can track which scene is actually loaded via scene changed event from SceneManager.
With ECS going on in mind, I don’t think Unity will or should devote resource to this.
And on the topic of ECS, it will have what you want (Probably) as a built-in editor for the entities that are in the scene.
I’ve never found adding 1 GameObject to the scene to hold scene related components to be all that cumbersome.