forked from BilalY/Rasagar
24 lines
853 B
C#
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();
|
|
}
|
|
}
|
|
}
|