Rasagar/Library/PackageCache/com.unity.cinemachine/Editor/Editors/CinemachineHardLockToTargetEditor.cs
2024-08-26 23:07:20 +03:00

24 lines
853 B
C#

using UnityEditor;
using UnityEngine;
namespace Cinemachine.Editor
{
[CustomEditor(typeof(CinemachineHardLockToTarget))]
[CanEditMultipleObjects]
internal sealed class CinemachineHardLockToTargetEditor : BaseEditor<CinemachineHardLockToTarget>
{
public override void OnInspectorGUI()
{
BeginInspector();
bool needWarning = false;
for (int i = 0; !needWarning && i < targets.Length; ++i)
needWarning = (targets[i] as CinemachineHardLockToTarget).FollowTarget == null;
if (needWarning)
EditorGUILayout.HelpBox(
"Hard Lock requires a Follow Target. Change Body to Do Nothing if you don't want a Follow target.",
MessageType.Warning);
DrawRemainingPropertiesInInspector();
}
}
}