Skip to content

Instantly share code, notes, and snippets.

@togucchi
Created February 11, 2021 15:25
Switching Render Pipeline at runtime
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