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
58
59
60
61
62
63
64
65
66
67
|
using UnityEngine;
using UnityEditor;
using System.Collections;
using AC;
[CustomEditor (typeof (AC.Char))]
public class CharEditor : Editor
{
public override void OnInspectorGUI ()
{
AC.Char _target = (AC.Char) target;
if (_target.animEngine == null || !_target.animEngine.ToString ().Contains (_target.animationEngine.ToString ()))
{
_target.ResetAnimationEngine ();
}
_target.animationEngine = (AnimationEngine) EditorGUILayout.EnumPopup ("Animation engine:", _target.animationEngine);
if (_target.animationEngine == AnimationEngine.Sprites2DToolkit && !tk2DIntegration.IsDefinePresent ())
{
EditorGUILayout.HelpBox ("The 'tk2DIsPresent' preprocessor define must be declared in the\ntk2DIntegration.cs script. Please open it and follow instructions.", MessageType.Warning);
}
EditorGUILayout.BeginVertical ("Button");
_target.animEngine.CharSettingsGUI ();
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
EditorGUILayout.LabelField ("Movement settings:", EditorStyles.boldLabel);
_target.walkSpeedScale = EditorGUILayout.FloatField ("Walk speed scale:", _target.walkSpeedScale);
_target.runSpeedScale = EditorGUILayout.FloatField ("Run speed scale:", _target.runSpeedScale);
_target.turnSpeed = EditorGUILayout.FloatField ("Turn speed:", _target.turnSpeed);
_target.acceleration = EditorGUILayout.FloatField ("Acceleration:", _target.acceleration);
_target.deceleration = EditorGUILayout.FloatField ("Deceleration:", _target.deceleration);
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
EditorGUILayout.LabelField ("Rigidbody settings:", EditorStyles.boldLabel);
_target.ignoreGravity = EditorGUILayout.Toggle ("Ignore gravity?", _target.ignoreGravity);
_target.freezeRigidbodyWhenIdle = EditorGUILayout.Toggle ("Freeze when Idle?", _target.freezeRigidbodyWhenIdle);
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
EditorGUILayout.LabelField ("Audio clips:", EditorStyles.boldLabel);
_target.walkSound = (AudioClip) EditorGUILayout.ObjectField ("Walk sound:", _target.walkSound, typeof (AudioClip), false);
_target.runSound = (AudioClip) EditorGUILayout.ObjectField ("Run sound:", _target.runSound, typeof (AudioClip), false);
_target.soundChild = (Sound) EditorGUILayout.ObjectField ("Sound child:", _target.soundChild, typeof (Sound), true);
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
EditorGUILayout.LabelField ("Dialogue settings:", EditorStyles.boldLabel);
_target.portraitGraphic = (Texture2D) EditorGUILayout.ObjectField ("Portrait graphic:", _target.portraitGraphic, typeof (Texture2D), true);
_target.speechColor = EditorGUILayout.ColorField ("Speech text colour:", _target.speechColor);
EditorGUILayout.EndVertical ();
if (GUI.changed)
{
EditorUtility.SetDirty (_target);
}
}
}
|