您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

50 行
1.4 KiB

using UnityEngine;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[ExecuteInEditMode]
public class SceneSettings : MonoBehaviour
{
public CommonSettings commonSettings
{
set { m_CommonSettings = value; }
get { return m_CommonSettings; }
}
public SkySettings skySettings
{
set { m_SkySettings = value; }
get { return m_SkySettings; }
}
[SerializeField] private CommonSettings m_CommonSettings = null;
[SerializeField] private SkySettings m_SkySettings = null;
// Use this for initialization
void OnEnable()
{
SceneSettingsManager.instance.AddSceneSettings(this);
HDRenderPipeline hdPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline;
if (hdPipeline != null)
{
hdPipeline.OnSceneLoad();
}
}
void OnDisable()
{
SceneSettingsManager.instance.RemoveSceneSettings(this);
}
void OnValidate()
{
// If the setting is already the one currently used we need to tell the manager to reapply it.
if (SceneSettingsManager.instance.GetCurrentSceneSetting())
{
SceneSettingsManager.instance.UpdateCurrentSceneSetting();
}
}
}
}