private void OnSceneGUI() { Vector3 pos = planeMonoBehaviour.gameObject.transform.position; float size = planeBuilder.Width; Handles.Label(pos, "asdasda"); float snap = 0.5f; Quaternion rot = Quaternion.Euler(planeBuilder.Rotation); planeBuilder.SetWidth(Handles.ScaleValueHandle ( planeBuilder.Width, pos, Quaternion.identity, planeBuilder.Width, Handles.ArrowHandleCap, snap )); }
public override void OnInspectorGUI() { planeMonoBehaviour = (PlaneMonoBehaviour)target; planeBuilder = planeMonoBehaviour.Builder; BasePrimitiveMonoBehaviourEditor <PlaneBuilder> .GenerateBaseFields(planeBuilder); EditorGUI.BeginDisabledGroup(!planeBuilder.FrontSided && !planeBuilder.BackSided); EditorGUILayout.Space(); EditorGUILayout.LabelField("Plane Settings", EditorStyles.boldLabel); planeBuilder.SetWidth(EditorGUILayout.FloatField("Width", planeBuilder.Width)); planeBuilder.SetHeight(EditorGUILayout.FloatField("Height", planeBuilder.Height)); planeBuilder.SetNumberOfSegmentsWidth(EditorGUILayout.IntField("Number Of Segments Width", planeBuilder.NumberOfSegmentsWidth)); planeBuilder.SetNumberOfSegmentsHeight(EditorGUILayout.IntField("Number Of Segments Height", planeBuilder.NumberOfSegmentsHeight)); EditorGUI.EndDisabledGroup(); planeMonoBehaviour.RecreateMesh(); }