Skip to content

Commit b2898ec

Browse files
committed
hide update rate for some publishers as they are drivent by the sensors
1 parent c861e17 commit b2898ec

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Linq;
2+
using System.Collections;
3+
using System.Collections.Generic;
4+
using UnityEngine;
5+
using UnityEditor;
6+
using ZO.ROS.Publisher;
7+
8+
namespace ZO.Editor {
9+
10+
[CustomEditor(typeof(ZO.ROS.Publisher.ZOROSIMUPublisher))]
11+
public class ZOROSIMUPublisherEditor : UnityEditor.Editor {
12+
13+
/// <summary>
14+
/// Hides unused ROSTopic. See: https://answers.unity.com/questions/316286/how-to-remove-script-field-in-inspector.html
15+
/// </summary>
16+
/// <value></value>
17+
private static readonly string[] _dontIncludeMe = new string[] { "_updateRateHz" };
18+
public override void OnInspectorGUI() {
19+
20+
DrawPropertiesExcluding(serializedObject, _dontIncludeMe);
21+
serializedObject.ApplyModifiedProperties();
22+
23+
}
24+
}
25+
26+
}

Editor/CustomEditors/ZOROSIMUPublisherEditor.cs.meta

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

Editor/CustomEditors/ZOROSImagePublisherEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class ZOROSImagePublisherEditor : UnityEditor.Editor {
1414
/// Hides unused ROSTopic. See: https://answers.unity.com/questions/316286/how-to-remove-script-field-in-inspector.html
1515
/// </summary>
1616
/// <value></value>
17-
private static readonly string[] _dontIncludeMe = new string[] { "_ROSTopic", "_name" };
17+
private static readonly string[] _dontIncludeMe = new string[] { "_ROSTopic", "_name", "_updateRateHz" };
1818
public override void OnInspectorGUI() {
1919

2020
DrawPropertiesExcluding(serializedObject, _dontIncludeMe);

Editor/CustomEditors/ZOROSStereoImagePublisherEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class ZOROSStereoImagePublisherEditor : UnityEditor.Editor {
1414
/// Hides unused ROSTopic. See: https://answers.unity.com/questions/316286/how-to-remove-script-field-in-inspector.html
1515
/// </summary>
1616
/// <value></value>
17-
private static readonly string[] _dontIncludeMe = new string[] { "_ROSTopic", "_name" };
17+
private static readonly string[] _dontIncludeMe = new string[] { "_ROSTopic", "_name", "_updateRateHz" };
1818
public override void OnInspectorGUI() {
1919

2020
DrawPropertiesExcluding(serializedObject, _dontIncludeMe);

0 commit comments

Comments
 (0)