void OnSceneGUI() { LevelBuilderCommon.ParseEvent(Event.current); LevelBuilderRoot root = target as LevelBuilderRoot; LevelBuilder levelBuilder = LevelBuilder.lastBuilder; LevelBuilderCommon.Default5ActionButton(root.transform.position + new Vector3(0, 1.5f, 0)); }
void OnSceneGUI() { LevelBuilderCommon.ParseEvent(Event.current); Transform transform = (target as MonoBehaviour).GetComponent <Transform>() as Transform; float size = HandleUtility.GetHandleSize(transform.position); float snap = LevelBuilder.levelUnit; Vector3 translateVector = new Vector3(-1f, 1f, -1f); EditorGUI.BeginChangeCheck(); Vector3 newTargetPosition = Handles.Slider(transform.position, translateVector, size, Handles.ArrowHandleCap, snap); if (EditorGUI.EndChangeCheck() && (newTargetPosition - transform.position).magnitude > 1f) { Undo.RegisterUndo(transform, "Change Look At Target Position"); transform.Translate((newTargetPosition.x > transform.position.x ? -1 : 1) * translateVector); } }