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
52
53
54
55
56
57
|
using UnityEngine;
using UnityEditor;
using System.Collections;
using AC;
[CustomEditor(typeof(ArrowPrompt))]
public class ArrowPromptEditor : Editor
{
public override void OnInspectorGUI()
{
ArrowPrompt _target = (ArrowPrompt) target;
_target.arrowPromptType = (ArrowPromptType) EditorGUILayout.EnumPopup ("Input type:", _target.arrowPromptType);
EditorGUILayout.BeginVertical ("Button");
GUILayout.Label ("Up arrow", EditorStyles.boldLabel);
ArrowGUI (_target.upArrow);
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
GUILayout.Label ("Left arrow", EditorStyles.boldLabel);
ArrowGUI (_target.leftArrow);
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
GUILayout.Label ("Right arrow", EditorStyles.boldLabel);
ArrowGUI (_target.rightArrow);
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
GUILayout.Label ("Down arrow", EditorStyles.boldLabel);
ArrowGUI (_target.downArrow);
EditorGUILayout.EndVertical ();
if (GUI.changed)
{
EditorUtility.SetDirty (_target);
}
}
public void ArrowGUI (Arrow arrow)
{
if (arrow != null)
{
arrow.isPresent = EditorGUILayout.Toggle ("Provide?", arrow.isPresent);
if (arrow.isPresent)
{
arrow.texture = (Texture2D) EditorGUILayout.ObjectField ("Icon texture:", arrow.texture, typeof (Texture2D), true);
arrow.linkedCutscene = (Cutscene) EditorGUILayout.ObjectField ("Linked Cutscene:", arrow.linkedCutscene, typeof (Cutscene), true);
}
}
}
}
|
Revision |
Author |
Commited |
Message |
83
|
FMMortaroli
|
Tue 13 May, 2014 11:32:51 +0000 |
|