Created
February 11, 2021 15:25
Switching Render Pipeline at runtime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Rendering; | |
public class RuntimePipelineSwitcher : MonoBehaviour | |
{ | |
[SerializeField] | |
private RenderPipelineAsset pipelineAsset; | |
private RenderPipelineAsset renderPipelineAsset; | |
void Update() | |
{ | |
if(Input.GetKeyDown(KeyCode.S)) | |
{ | |
if (renderPipelineAsset == null) | |
{ | |
renderPipelineAsset = pipelineAsset; | |
} | |
else | |
{ | |
renderPipelineAsset = null; | |
} | |
GraphicsSettings.renderPipelineAsset = renderPipelineAsset; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment