Tanoda
pb_MaterialInspector.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(Material))]
11 public class pb_MaterialInspector : pb_TypeInspector
12 {
13 Material value;
14
15 public UnityEngine.UI.Text title;
16 public UnityEngine.UI.InputField dropbox;
17
18 void OnGUIChanged()
19 {
20 SetValue(value);
21 }
22
23 public override void InitializeGUI()
24 {
25 title.text = GetName().SplitCamelCase();
26 }
27
28 protected override void OnUpdateGUI()
29 {
30 value = GetValue<Material>();
31 dropbox.text = (value == null ? "null" : value.ToString());
32 }
33
34 public void OnValueChange(Material val)
35 {
36 value = val;
37 OnGUIChanged();
38 }
39 }
40}