Hi there,
I just noticed that the Handles.FreeMoveHandle doesn’t change color when the mouse hovers over the handle. What’s up with that?
It’s not the most vital bug, but it does affect the UX of my editor.
Thanks.
Hi there,
I just noticed that the Handles.FreeMoveHandle doesn’t change color when the mouse hovers over the handle. What’s up with that?
It’s not the most vital bug, but it does affect the UX of my editor.
Thanks.
Weird. It’s working for me. Have you tried with a barebones example? What version of Unity are you on?
using UnityEngine;
[ExecuteInEditMode]
public class FreeMoveHandleExample : MonoBehaviour
{
public Vector3 targetPosition { get { return m_TargetPosition; } set { m_TargetPosition = value; } }
[SerializeField]
private Vector3 m_TargetPosition = new Vector3(1f, 0f, 2f);
public virtual void Update()
{
transform.LookAt(m_TargetPosition);
}
}
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(FreeMoveHandleExample)), CanEditMultipleObjects]
public class FreeMoveHandleExampleEditor : Editor
{
protected virtual void OnSceneGUI()
{
FreeMoveHandleExample example = (FreeMoveHandleExample)target;
float size = HandleUtility.GetHandleSize(example.targetPosition) * 0.5f;
Vector3 snap = Vector3.one * 0.5f;
EditorGUI.BeginChangeCheck();
Handles.color = Color.red;
Vector3 newTargetPosition = Handles.FreeMoveHandle(example.targetPosition, Quaternion.identity, size, snap, Handles.RectangleHandleCap);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(example, "Change Look At Target Position");
example.targetPosition = newTargetPosition;
example.Update();
}
}
}