AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
Int3Drawer.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using UnityEditor;
5 using UnityEngine;
6 
7 namespace HoloToolkit.Unity
8 {
12  [CustomPropertyDrawer(typeof(Int3))]
13  public class Int3Drawer : PropertyDrawer
14  {
15  public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
16  {
17  label = EditorGUI.BeginProperty(position, label, property);
18  var contentPosition = EditorGUI.PrefixLabel(position, label);
19 
20  var subLabels = new GUIContent[3];
21  subLabels[0] = new GUIContent("x");
22  subLabels[1] = new GUIContent("y");
23  subLabels[2] = new GUIContent("z");
24 
25  EditorGUI.MultiPropertyField(contentPosition, subLabels, property.FindPropertyRelative("x"));
26 
27  EditorGUI.EndProperty();
28  }
29  }
30 }
Property drawer for in-editor display/editing of Int3 data
Definition: Int3Drawer.cs:13
override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
Definition: Int3Drawer.cs:15