Tanoda
pb_BoolInspector.cs
Go to the documentation of this file.
1using UnityEngine;
2using System.Collections;
3using System.Reflection;
4
5namespace GILES.Interface
6{
10 [pb_TypeInspector(typeof(bool))]
11 public class pb_BoolInspector : pb_TypeInspector
12 {
13 bool value;
14
15 public UnityEngine.UI.Text title;
16 public UnityEngine.UI.Toggle input;
17
18 public override void InitializeGUI()
19 {
20 title.text = GetName().SplitCamelCase();
21 input.onValueChanged.AddListener( OnValueChange );
22 }
23
24 protected override void OnUpdateGUI()
25 {
26 value = GetValue<bool>();
27 input.isOn = value;
28 }
29
30 public void OnValueChange(bool val)
31 {
32 value = val;
33 SetValue(value);
34 }
35 }
36}