Search Unity

How can I access per-scene RenderSettings in code?

Discussion in 'Editor & General Support' started by BenPlaysport, Apr 20, 2016.

  1. BenPlaysport

    BenPlaysport

    Joined:
    Oct 30, 2015
    Posts:
    6
    Different scenes can have different lighting settings. Loading them up changes what's shown in the 'lighting' editor window. Loading multiple scenes additively, then changing the active scene, also changes what's shown in the lighting window. So clearly, lighting settings are stored per-scene.

    In code though, the RenderSettings (and LightmapSettings, and probably many others) provide access to just a bunch of static properties, which only appear to reflect the state of the active scene.

    Is these any way to access these settings per-scene from code? There's nothing on UnityEngine.SceneManagement.Scene - this provides access to the GameObjects in the scene but nothing else of much use.

    I want access to this because I have some objects that I want to affect the lighting of the scene they are in, possibly before that scene becomes active.
     
    kyte and chrismarch like this.