Tanoda
PostProcessProviderEditor.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
9using Leap.Unity;
10using System.Collections;
11using System.Collections.Generic;
12using UnityEditor;
13using UnityEngine;
14
15namespace Leap.Unity {
16
17 [CustomEditor(typeof(PostProcessProvider), editorForChildClasses: true)]
18 public class PostProcessProviderEditor : CustomEditorBase<PostProcessProvider> {
19
20 protected override void OnEnable() {
21 base.OnEnable();
22
23 // Edit-time pose is only relevant for providers that generate hands.
24 // Post-process Providers are a special case and don't generate their own hands.
25 specifyConditionalDrawing(() => false, "editTimePose");
26 }
27
28 public override void OnInspectorGUI() {
29 base.OnInspectorGUI();
30
31 drawNotificationsGUI();
32 }
33
34 private void drawNotificationsGUI() {
35 var provider = this.target;
36
37 if (!provider.enabled) {
38 EditorGUILayout.HelpBox(
39 message: "This post-process provider is disabled, so it will not output any "
40 + "hand data. Use pass-through mode if you only want to disable its "
41 + "post-processing and still output hands.",
42 type: MessageType.Info
43 );
44 }
45 else if (provider.passthroughOnly) {
46 EditorGUILayout.HelpBox(
47 message: "This post-process provider is set to pass-through only, so it will "
48 + "pass its input unmodified to its output.",
49 type: MessageType.Info
50 );
51 }
52 }
53
54 }
55
56}
void specifyConditionalDrawing(string conditionalName, params string[] dependantProperties)
Specify a list of properties that should only be displayed if the conditional property has a value of...
override void OnEnable()
override void OnInspectorGUI()