mirror of
https://github.com/nothke/quality-control.git
synced 2025-10-04 14:05:56 +00:00
28 lines
989 B
C#
28 lines
989 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEditor;
|
|
|
|
namespace KinematicCharacterController
|
|
{
|
|
[CustomEditor(typeof(KinematicCharacterMotor))]
|
|
public class KinematicCharacterMotorEditor : Editor
|
|
{
|
|
protected virtual void OnSceneGUI()
|
|
{
|
|
KinematicCharacterMotor motor = (target as KinematicCharacterMotor);
|
|
if (motor)
|
|
{
|
|
Vector3 characterBottom = motor.transform.position + (motor.Capsule.center + (-Vector3.up * (motor.Capsule.height * 0.5f)));
|
|
|
|
Handles.color = Color.yellow;
|
|
Handles.CircleHandleCap(
|
|
0,
|
|
characterBottom + (motor.transform.up * motor.MaxStepHeight),
|
|
Quaternion.LookRotation(motor.transform.up, motor.transform.forward),
|
|
motor.Capsule.radius + 0.1f,
|
|
EventType.Repaint);
|
|
}
|
|
}
|
|
}
|
|
} |