您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
611 B
31 行
611 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Experimental.Rendering.LightweightPipeline;
|
|
|
|
[ExecuteInEditMode]
|
|
public class LODTweaker : MonoBehaviour {
|
|
|
|
void SetMaxLOD(Camera cam)
|
|
{
|
|
if (cam == Camera.main)
|
|
{
|
|
QualitySettings.lodBias = 3;
|
|
}
|
|
else
|
|
{
|
|
QualitySettings.lodBias = 0.5f;
|
|
}
|
|
}
|
|
|
|
void OnEnable()
|
|
{
|
|
LightweightPipeline.beginCameraRendering += SetMaxLOD;
|
|
}
|
|
|
|
void OnDisable()
|
|
{
|
|
LightweightPipeline.beginCameraRendering -= SetMaxLOD;
|
|
}
|
|
|
|
}
|