Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

C# access to the URP postpro settings??

Discussion in '2019.3 Beta' started by Davood_Kharmanzar, Aug 28, 2019.

  1. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    hello,
    how can i access to the universal render pipeline postpro settings on c#?

    Capture3.JPG Capture2.JPG
     
  2. Abruzzi

    Abruzzi

    Joined:
    Feb 6, 2015
    Posts:
    44
    Hi!

    It will be like this one:
    Code (CSharp):
    1. DepthOfField depthOfField;
    2. Camera.main.GetComponent<Volume>().profile.TryGet<DepthOfField>(out depthOfField); //Instanced profile
    3. //Camera.main.GetComponent<Volume>().sharedProfile.TryGet<DepthOfField>(out depthOfField); //Shared profile - this will overwrite original profile settings
    4.  
    5. if (depthOfField!=null) depthOfField.aperture.value = 0;
     
    Davood_Kharmanzar likes this.