36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
#if !UNITY_2019_3_OR_NEWER
|
|
#define CINEMACHINE_PHYSICS
|
|
#endif
|
|
|
|
using UnityEngine;
|
|
using UnityEditor;
|
|
|
|
namespace Cinemachine.Editor
|
|
{
|
|
#if CINEMACHINE_PHYSICS
|
|
[CustomEditor(typeof(Cinemachine3rdPersonFollow))]
|
|
internal class Cinemachine3rdPersonFollowEditor : BaseEditor<Cinemachine3rdPersonFollow>
|
|
{
|
|
[DrawGizmo(GizmoType.Active | GizmoType.Selected, typeof(Cinemachine3rdPersonFollow))]
|
|
static void Draw3rdPersonGizmos(Cinemachine3rdPersonFollow target, GizmoType selectionType)
|
|
{
|
|
if (target.IsValid)
|
|
{
|
|
Color originalGizmoColour = Gizmos.color;
|
|
Gizmos.color = CinemachineCore.Instance.IsLive(target.VirtualCamera)
|
|
? CinemachineSettings.CinemachineCoreSettings.ActiveGizmoColour
|
|
: CinemachineSettings.CinemachineCoreSettings.InactiveGizmoColour;
|
|
|
|
target.GetRigPositions(out Vector3 root, out Vector3 shoulder, out Vector3 hand);
|
|
Gizmos.DrawLine(root, shoulder);
|
|
Gizmos.DrawLine(shoulder, hand);
|
|
Gizmos.DrawSphere(root, 0.02f);
|
|
Gizmos.DrawSphere(shoulder, 0.02f);
|
|
Gizmos.DrawSphere(hand, 0.03f);
|
|
Gizmos.color = originalGizmoColour;
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
}
|