You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.2 KiB
48 lines
1.2 KiB
using UnityEngine;
|
|
using UnityEngine.Rendering;
|
|
using UnityEngine.Rendering.HighDefinition;
|
|
|
|
namespace UnityEditor.Rendering.HighDefinition
|
|
{
|
|
[CustomEditor(typeof(Camera))]
|
|
[SupportedOnRenderPipeline(typeof(HDRenderPipelineAsset))]
|
|
[CanEditMultipleObjects]
|
|
partial class HDCameraEditor : Editor
|
|
{
|
|
SerializedHDCamera m_SerializedCamera;
|
|
|
|
void OnEnable()
|
|
{
|
|
m_SerializedCamera = new SerializedHDCamera(serializedObject);
|
|
|
|
Undo.undoRedoPerformed += ReconstructReferenceToAdditionalDataSO;
|
|
}
|
|
|
|
void ReconstructReferenceToAdditionalDataSO()
|
|
{
|
|
OnDisable();
|
|
OnEnable();
|
|
}
|
|
|
|
void OnDisable()
|
|
{
|
|
Undo.undoRedoPerformed -= ReconstructReferenceToAdditionalDataSO;
|
|
}
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
m_SerializedCamera.Update();
|
|
|
|
if (HDEditorUtils.IsPresetEditor(this))
|
|
{
|
|
HDCameraUI.PresetInspector.Draw(m_SerializedCamera, this);
|
|
}
|
|
else
|
|
{
|
|
HDCameraUI.Inspector.Draw(m_SerializedCamera, this);
|
|
}
|
|
|
|
m_SerializedCamera.Apply();
|
|
}
|
|
}
|
|
}
|