Nextrek
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
using UnityEngine;
using System.Collections;
using UnityEditor;
using AC;
[CustomEditor (typeof (MenuLink))]
public class MenuLinkEditor : Editor
{
private MenuLink _target;
private void OnEnable ()
{
_target = (MenuLink) target;
}
public override void OnInspectorGUI ()
{
if (_target == null)
{
return;
}
if (Application.isPlaying)
{
EditorGUILayout.LabelField ("Menu name:", _target.menuName);
EditorGUILayout.LabelField ("Element name:",_target.elementName);
EditorGUILayout.LabelField ("Slot number:", _target.slot.ToString ());
EditorGUILayout.LabelField ("Is visible?", _target.IsVisible ().ToString ());
if (GUILayout.Button ("Interact"))
{
_target.Interact ();
}
}
else
{
_target.menuName = EditorGUILayout.TextField ("Menu name:", _target.menuName);
_target.elementName = EditorGUILayout.TextField ("Element name:", _target.elementName);
_target.slot = EditorGUILayout.IntField ("Slot number (optional):", _target.slot);
}
if (GUI.changed)
{
EditorUtility.SetDirty (_target);
}
}
}
|
Revision |
Author |
Commited |
Message |
83
|
FMMortaroli
|
Tue 13 May, 2014 11:32:51 +0000 |
|