您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
33 行
638 B
33 行
638 B
using System.Collections.Generic;
|
|
using UnityEngine.Experimental.Rendering;
|
|
|
|
namespace UnityEngine.ScriptableRenderPipeline
|
|
{
|
|
public class DefaultCameraProvider : ICameraProvider
|
|
{
|
|
public Camera overrideCamera { get; set; }
|
|
|
|
public static void GetCamerasToRenderDefault(List<Camera> cameras)
|
|
{
|
|
cameras.Clear();
|
|
foreach (var c in Camera.allCameras)
|
|
{
|
|
if (c.enabled)
|
|
cameras.Add(c);
|
|
}
|
|
}
|
|
|
|
public void GetCamerasToRender(List<Camera> cameras)
|
|
{
|
|
if (overrideCamera != null)
|
|
{
|
|
cameras.Clear();
|
|
cameras.Add(overrideCamera);
|
|
}
|
|
else
|
|
{
|
|
GetCamerasToRenderDefault(cameras);
|
|
}
|
|
}
|
|
}
|
|
}
|