Rasagar/Library/PackageCache/com.unity.visualeffectgraph/Samples~/VFXOutputEventHandlers/Editor/VFXOutputEventCinemachineCameraShakeEditor.cs

35 lines
1.3 KiB
C#
Raw Normal View History

2024-08-26 13:07:20 -07:00
#if VFX_OUTPUTEVENT_CINEMACHINE_2_6_0_OR_NEWER
using UnityEngine;
using UnityEngine.VFX.Utility;
namespace UnityEditor.VFX.Utility
{
[CustomEditor(typeof(VFXOutputEventCinemachineCameraShake))]
class VFXOutputEventCinemachineCameraShakeEditor : VFXOutputEventHandlerEditor
{
SerializedProperty m_CinemachineImpulseSource;
SerializedProperty m_AttributeSpace;
protected override void OnEnable()
{
base.OnEnable();
m_CinemachineImpulseSource = serializedObject.FindProperty(nameof(VFXOutputEventCinemachineCameraShake.cinemachineImpulseSource));
m_AttributeSpace = serializedObject.FindProperty(nameof(VFXOutputEventCinemachineCameraShake.attributeSpace));
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUI.BeginChangeCheck();
DrawOutputEventProperties();
EditorGUILayout.PropertyField(m_CinemachineImpulseSource);
EditorGUILayout.PropertyField(m_AttributeSpace);
HelpBox("Attribute Usage", "- position : position of the camera impulse\n- velocity : impulse velocity");
if (EditorGUI.EndChangeCheck())
serializedObject.ApplyModifiedProperties();
}
}
}
#endif