Hi,
I am trying to do a “save scene”. I am using EasySave asset. All the game-objects get saved / loaded. But lighting data is missing after performing “MergeScenes”. It appears to be saved in Assets/LightingData.asset.
Any suggestions on how this can be added to the newly created scene ?
Regards
/rk
This may be true. Are you changing it? Are you saving it? Do you need to?
In any case, if you have multiple scenes loaded only one of them is marked as the active scene, and that is the scene used for lighting, as outlined in these docs:
https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.SetActiveScene.html
So you might want to just make a lighting scene that you don’t save, and just always load that and set it as the active scene.
NOTE: you have to delay one frame after loading a scene in order to mark it active.
Thx for your suggestion Kurt. I have done the “SetActiveScene”. The issue is that “MergeScene” seems to act only on gameObjects in the scene. LightingData.asset is just lying around in the Asset folder. Is a solution along these grounds relevant ?. I have seen others post about it. It did not work for me yet. Something missing ?.
GameObject lightingData = Instantiate(Resources.Load(“Effects/LightingData.asset”)) as GameObject;
Regards
/rk
You cannot instantiate an asset as a GameObject.
There may be somewhere to put that, check the docs on lighting data.
I’ve only ever used an entire scene as my lighting config, loading it and setting it as the active. I have no experience fiddling with the individual lighting data assets.