Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Setting default render data asset through code

Discussion in 'Universal Render Pipeline' started by Garien, Feb 14, 2024.

  1. Garien


    Oct 11, 2018
    Hello, I'm working on a game that uses multiple RenderData.asset, as some scenes are 3D and others, 2D.

    I've assigned cameras in each scene to use specific RenderData.asset that works in that scene, so everything works fine in-game. However, the editor camera must be updated manually, which is becoming time consuming for us.

    Manually, we have to select our RenderAsset.asset and click on the "Set Default" button under the render list for the editor camera to work properly within each scene.

    To automate this, I wanted to create a script that works in editor-only, that would basically do what the Set Default button does once we enter a scene, either by referencing the render list index or the RenderData.asset itself.

    However, I haven't found a way to access and set them through code, which is why I'm here asking for help. Could someone that knows how to do this help me?

    Thank you.