Tanoda
LeapImageRetrieverEditor.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 UnityEngine;
10using UnityEditor;
11
12namespace Leap.Unity{
13 [CustomEditor(typeof(LeapImageRetriever))]
14 public class LeapImageRetrieverEditor : CustomEditorBase<LeapImageRetriever> {
15
16 private GUIContent _textureGUIContent;
17 private GUIContent _distortionTextureGUIContent;
18
19 protected override void OnEnable() {
20 base.OnEnable();
21
22 _textureGUIContent = new GUIContent("Sensor Texture");
23 _distortionTextureGUIContent = new GUIContent("Distortion Texture");
24 }
25
26 public override void OnInspectorGUI() {
27 base.OnInspectorGUI();
28
29 if (Application.isPlaying) {
30 var data = target.TextureData;
31 var dataType = typeof(Object);
32
33 EditorGUI.BeginDisabledGroup(true);
34 EditorGUILayout.ObjectField(_textureGUIContent, data.TextureData.CombinedTexture, dataType, true);
35 EditorGUILayout.ObjectField(_distortionTextureGUIContent, data.Distortion.CombinedTexture, dataType, true);
36 EditorGUI.EndDisabledGroup();
37 }
38 }
39 }
40}
UnityEngine.Object Object