Tanoda
AnchorEditor.cs
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (C) Ultraleap, Inc. 2011-2020. *
3
* *
4
* Use subject to the terms of the Apache License 2.0 available at *
5
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6
* between Ultraleap and you, your company or other organization. *
7
******************************************************************************/
8
9
using
Leap
.
Unity
;
10
using
System.Collections;
11
using
System.Collections.Generic;
12
using
UnityEditor
;
13
using
UnityEngine
;
14
15
namespace
Leap.Unity.Interaction
{
16
17
[CanEditMultipleObjects]
18
[CustomEditor(typeof(Anchor))]
19
public
class
AnchorEditor
:
CustomEditorBase
<Anchor> {
20
21
protected
override
void
OnEnable
() {
22
base.OnEnable();
23
24
deferProperty
(
"_eventTable"
);
25
specifyCustomDrawer
(
"_eventTable"
, drawEventTable);
26
}
27
28
private
EnumEventTableEditor
_tableEditor;
29
private
void
drawEventTable(SerializedProperty property) {
30
if
(_tableEditor ==
null
) {
31
_tableEditor =
new
EnumEventTableEditor
(property, typeof(
Anchor
.
EventType
));
32
}
33
34
_tableEditor.
DoGuiLayout
();
35
}
36
37
}
38
39
}
Leap.Unity.CustomEditorBase
Definition:
CustomEditorBase.cs:17
Leap.Unity.CustomEditorBase< Anchor >::deferProperty
void deferProperty(string propertyName)
Defer rendering of a property until the end of the inspector. Deferred properties are drawn in the RE...
Definition:
CustomEditorBase.cs:176
Leap.Unity.CustomEditorBase< Anchor >::specifyCustomDrawer
void specifyCustomDrawer(string propertyName, Action< SerializedProperty > propertyDrawer)
Specify a callback to be used to draw a specific named property. Should be called in OnEnable.
Definition:
CustomEditorBase.cs:56
Leap.Unity.EnumEventTableEditor
Definition:
EnumEventTableEditor.cs:16
Leap.Unity.EnumEventTableEditor.DoGuiLayout
void DoGuiLayout()
Definition:
EnumEventTableEditor.cs:46
Leap.Unity.Interaction.AnchorEditor
Definition:
AnchorEditor.cs:19
Leap.Unity.Interaction.AnchorEditor.OnEnable
override void OnEnable()
Definition:
AnchorEditor.cs:21
Leap.Unity.Interaction.Anchor
Definition:
Anchor.cs:19
Leap.Unity.Interaction.Anchor.EventType
EventType
Definition:
Anchor.cs:211
Leap.Unity.Interaction
Definition:
MovePoseExample.cs:11
Leap.Unity
Definition:
AssetFolderPropertyDrawer.cs:15
Leap
Definition:
AssetFolderPropertyDrawer.cs:15
UnityEditor
Definition:
BoxSliderEditor.cs:6
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
Plugins
LeapMotion
Modules
InteractionEngine
Scripts
UI
Anchors
Editor
AnchorEditor.cs
Generated by
1.9.3