I’ve been trying to add some basic handles to an object to adjust values in a script. I’ve looked into Handles.Slider(), Handles.ScaleSlider(), Handles.Slider2D() and I can’t actually get the handles to move. Even the most simple implementation. It will draw the initial handle just fine, and I can select the handles, but they don’t actually do anything when I try to drag/move them. Here is a super simple example:
using UnityEngine;
using UnityEditor;
using System.Collections;
[CustomEditor(typeof(Foo))]
public class FooEditor : Editor {
public override void OnInspectorGUI ()
{
EditorGUIUtility.LookLikeInspector();
base.OnInspectorGUI ();
}
public void OnSceneGUI()
{
Foo testObject = (Foo)target;
Handles.color = Color.magenta;
Vector3 vectorPoint = Handles.Slider( testObject.transform.position, Vector3.left );
if( GUI.changed )
EditorUtility.SetDirty(testObject);
}
}
I’m guessing there is something obvious I’m missing, but I can’t seem to figure it out. Thanks.