Skip to content

Commit 0538707

Browse files
committed
Added a basic custom editor for SpeechInputHandler
1 parent 2b24298 commit 0538707

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using UnityEditor;
3+
using UnityEngine;
4+
5+
namespace HoloToolkit.Unity.InputModule
6+
{
7+
[CustomEditor(typeof(SpeechInputHandler))]
8+
public class SpeechInputHandlerEditor : Editor
9+
{
10+
public override void OnInspectorGUI()
11+
{
12+
SerializedProperty keywordsAndResponses = serializedObject.FindProperty("KeywordsAndResponses");
13+
14+
serializedObject.Update();
15+
EditorGUILayout.PropertyField(keywordsAndResponses, true);
16+
serializedObject.ApplyModifiedProperties();
17+
18+
// error and warning messages
19+
if (keywordsAndResponses.arraySize == 0)
20+
{
21+
EditorGUILayout.HelpBox("No keywords have been assigned!", MessageType.Warning);
22+
}
23+
}
24+
}
25+
}

Assets/HoloToolkit/Input/Scripts/Voice/Editor/SpeechInputHandlerEditor.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)