Search Unity

Question Setting scene Lighting->Environment settings via script

Discussion in 'High Definition Render Pipeline' started by lcompton, Mar 31, 2021.

  1. lcompton

    lcompton

    Joined:
    Mar 31, 2018
    Posts:
    102
    I'm working on an editor-based, procedural scene generation process. There's a root scene, which is mostly empty, that is responsible for loading subscenes based on the location of the player. The subscenes are created via script along with the contents of the root scene. I'm having difficulty figuring out how to set the Profile and Static Lighting Sky settings for my subscenes (found under the Lighting->Environment tab in the editor). I was able to set the lighting settings using "Lightmapping.lightingSettings". I can't find a corresponding property to set or method to call to set the HDRP-specific values.

    Is there a way to set these values in script? If so, some documentation links would be much appreciated.

    Thanks!
     
  2. AugmentedSpaceAgency

    AugmentedSpaceAgency

    Joined:
    May 11, 2017
    Posts:
    12
    If you want to set the different setting under Lighting -> Environment you should check out the RenderSettings class.