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
|
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor (typeof (Parallax2D))]
public class Parallax2DEditor : Editor
{
private Parallax2D _target;
private void OnEnable ()
{
_target = (Parallax2D) target;
}
public override void OnInspectorGUI ()
{
EditorGUILayout.BeginVertical ("Button");
_target.depth = EditorGUILayout.FloatField ("Depth:", _target.depth);
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
_target.xScroll = EditorGUILayout.BeginToggleGroup ("Scroll in X direction?", _target.xScroll);
_target.xOffset = EditorGUILayout.FloatField ("Offset:", _target.xOffset);
EditorGUILayout.EndToggleGroup ();
EditorGUILayout.EndVertical ();
EditorGUILayout.BeginVertical ("Button");
_target.yScroll = EditorGUILayout.BeginToggleGroup ("Scroll in Y direction?", _target.yScroll);
_target.yOffset = EditorGUILayout.FloatField ("Offset:", _target.yOffset);
EditorGUILayout.EndToggleGroup ();
EditorGUILayout.EndVertical ();
if (GUI.changed)
{
EditorUtility.SetDirty (_target);
}
}
}
|
Revision |
Author |
Commited |
Message |
83
|
FMMortaroli
|
Tue 13 May, 2014 11:32:51 +0000 |
|