Tanoda
pb_BoundsInspector.cs
Go to the documentation of this file.
1using UnityEngine;
2using System.Collections;
3using System.Reflection;
4
5namespace GILES.Interface
6{
7 [pb_TypeInspector(typeof(Bounds))]
8 public class pb_BoundsInspector : pb_TypeInspector
9 {
10 Bounds vector;
11
12 public UnityEngine.UI.Text title;
13
14 public UnityEngine.UI.InputField
18
19 void OnGUIChanged()
20 {
21 SetValue(vector);
22 }
23
24 public override void InitializeGUI()
25 {
26 title.text = GetName().SplitCamelCase();
27
28 input_x.interactable = false;
29 input_y.interactable = false;
30 input_z.interactable = false;
31 }
32
33 protected override void OnUpdateGUI()
34 {
35 vector = GetValue<Bounds>();
36
37 input_x.text = vector.size.x.ToString("F2") + "m";
38 input_y.text = vector.size.y.ToString("F2") + "m";
39 input_z.text = vector.size.z.ToString("F2") + "m";
40 }
41 }
42}
UnityEngine.UI.InputField input_x
UnityEngine.UI.InputField input_z
UnityEngine.UI.InputField input_y