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
58
59
60
61
|
using UnityEngine;
using UnityEditor;
using System.Collections;
[CustomEditor (typeof (FirstPersonCamera))]
public class FirstPersonCameraEditor : Editor
{
private static GUILayoutOption
labelWidth = GUILayout.MaxWidth (60),
intWidth = GUILayout.MaxWidth (130);
public override void OnInspectorGUI ()
{
FirstPersonCamera _target = (FirstPersonCamera) target;
EditorGUILayout.BeginVertical ("Button");
_target.headBob = EditorGUILayout.BeginToggleGroup ("Bob head when moving?", _target.headBob);
EditorGUILayout.BeginHorizontal ();
EditorGUILayout.LabelField ("Speed:", labelWidth);
_target.bobbingSpeed = EditorGUILayout.FloatField (_target.bobbingSpeed, intWidth);
EditorGUILayout.LabelField ("Amount:", labelWidth);
_target.bobbingAmount = EditorGUILayout.FloatField (_target.bobbingAmount, intWidth);
EditorGUILayout.EndHorizontal ();
EditorGUILayout.EndToggleGroup ();
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
_target.allowMouseWheelZooming = EditorGUILayout.BeginToggleGroup ("Allow mouse-wheel zooming?", _target.allowMouseWheelZooming);
EditorGUILayout.BeginHorizontal ();
EditorGUILayout.LabelField ("Min FOV:", labelWidth);
_target.minimumZoom = EditorGUILayout.FloatField (_target.minimumZoom, intWidth);
EditorGUILayout.LabelField ("Max FOV:", labelWidth);
_target.maximumZoom = EditorGUILayout.FloatField (_target.maximumZoom, intWidth);
EditorGUILayout.EndHorizontal ();
EditorGUILayout.EndToggleGroup ();
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
EditorGUILayout.LabelField ("Constrain Y-rotation (degrees)");
EditorGUILayout.BeginHorizontal ();
EditorGUILayout.LabelField ("Min:", labelWidth);
_target.minY = EditorGUILayout.FloatField (_target.minY, intWidth);
EditorGUILayout.LabelField ("Max:", labelWidth);
_target.maxY = EditorGUILayout.FloatField (_target.maxY, intWidth);
EditorGUILayout.EndHorizontal ();
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
_target.sensitivity = EditorGUILayout.Vector2Field ("Freelook sensitivity:", _target.sensitivity);
EditorGUILayout.EndVertical ();
if (GUI.changed)
{
EditorUtility.SetDirty (_target);
}
}
}
|
Revision |
Author |
Commited |
Message |
83
|
FMMortaroli
|
Tue 13 May, 2014 11:32:51 +0000 |
|