-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved world redirection visualization data to JsonLogging
- Loading branch information
1 parent
4919238
commit 47ae5e6
Showing
6 changed files
with
311 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...tic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Editor/Logging/JsonLoggingEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
namespace VHToolkit.Logging | ||
{ | ||
[CustomEditor(typeof(JsonLogging)), CanEditMultipleObjects] | ||
public class JsonLoggingEditor : Editor | ||
{ | ||
SerializedProperty logDirectoryPath, optionalFilenamePrefix, | ||
filename, pythonPath; | ||
private void OnEnable() | ||
{ | ||
logDirectoryPath = serializedObject.FindProperty("logDirectoryPath"); | ||
optionalFilenamePrefix = serializedObject.FindProperty("optionalFilenamePrefix"); | ||
filename = serializedObject.FindProperty("filename"); | ||
pythonPath = serializedObject.FindProperty("pythonPath"); | ||
} | ||
private void MakePropertyField(SerializedProperty property, string text, string tooltip = null) | ||
{ | ||
EditorGUILayout.PropertyField(property, new GUIContent(text, tooltip)); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
GUI.enabled = false; | ||
EditorGUILayout.ObjectField("Script:", MonoScript.FromMonoBehaviour((JsonLogging) target), typeof(JsonLogging), false); | ||
GUI.enabled = true; | ||
|
||
serializedObject.Update(); | ||
|
||
EditorGUILayout.Space(5); | ||
EditorGUILayout.LabelField("Json logging Parameters", EditorStyles.largeLabel); | ||
|
||
MakePropertyField(logDirectoryPath, "Log directory Path", "The directory path inside which json file(s) will be created"); | ||
MakePropertyField(optionalFilenamePrefix, "Optional filename prefix", "Optional prefix for the json file"); | ||
|
||
EditorGUILayout.Space(5); | ||
EditorGUILayout.LabelField("TCP Socket Parameters", EditorStyles.largeLabel); | ||
|
||
MakePropertyField(filename, "Python visualizer script", "File name for the Python visualization script."); | ||
MakePropertyField(pythonPath, "Python Path", "File name for the Python executable path."); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...oolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Editor/Logging/JsonLoggingEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.