Skip to content

Commit a671bd1

Browse files
committed
Use nameof operator for DynamicallyShowInInspector attribute
1 parent c52126d commit a671bd1

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

AGXUnity/Sensor/AmbientMaterial.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public ConfigurationType AmbientType
5858
/// <summary>
5959
/// The visibility of objects as defined by the meterological optical range (MOR) of the medium.
6060
/// </summary>
61-
[DynamicallyShowInInspector( "HasVisibility", true )]
61+
[DynamicallyShowInInspector( nameof( HasVisibility ), true )]
6262
[ClampAboveZeroInInspector()]
6363
[Tooltip( "The visibility of objects as defined by the meterological optical range (MOR) of the medium." )]
6464
public float Visibility
@@ -79,7 +79,7 @@ public float Visibility
7979
/// <summary>
8080
/// The rate of percipitation in the atmosphere.
8181
/// </summary>
82-
[DynamicallyShowInInspector( "HasRate", true )]
82+
[DynamicallyShowInInspector( nameof( HasRate ), true )]
8383
[ClampAboveZeroInInspector( true )]
8484
[Tooltip( "The rate of percipitation in the atmosphere." )]
8585
public float Rate
@@ -100,7 +100,7 @@ public float Rate
100100
/// <summary>
101101
/// The signal wavelength used to configure the medium.
102102
/// </summary>
103-
[DynamicallyShowInInspector( "HasWavelength", true )]
103+
[DynamicallyShowInInspector( nameof( HasWavelength ), true )]
104104
[ClampAboveZeroInInspector()]
105105
[Tooltip( "The signal wavelength used to configure the medium." )]
106106
public float Wavelength
@@ -121,7 +121,7 @@ public float Wavelength
121121
/// <summary>
122122
/// A maritimeness parameter used to specify an interpolation value between fine droplet continental radiation fog (0.0) and large droplet maritime fog (1.0).
123123
/// </summary>
124-
[DynamicallyShowInInspector( "HasMaritimeness", true )]
124+
[DynamicallyShowInInspector( nameof( HasMaritimeness ), true )]
125125
[FloatSliderInInspector( 0, 1 )]
126126
[Tooltip( "A maritimeness parameter used to specify an interpolation value between fine droplet continental radiation fog (0.0) and large droplet maritime fog (1.0)." )]
127127
public float Maritimeness
@@ -142,7 +142,7 @@ public float Maritimeness
142142
/// <summary>
143143
/// A tropicalness parameter used to specify an interpolation value between common rain of smaller drop size (0.0) and tropical rain of larger drop size (1.0).
144144
/// </summary>
145-
[DynamicallyShowInInspector( "HasTropicalness", true )]
145+
[DynamicallyShowInInspector( nameof( HasTropicalness ), true )]
146146
[FloatSliderInInspector( 0, 1 )]
147147
[Tooltip( "A tropicalness parameter used to specify an interpolation value between common rain of smaller drop size (0.0) and tropical rain of larger drop size (1.0)." )]
148148
public float Tropicalness

AGXUnity/Sensor/LidarSensor.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public class LidarSensor : ScriptComponent
103103
[Tooltip( "The Model, or preset, of this Lidar. " +
104104
"Changing this will assign Model specific properties to this Lidar." )]
105105
[DisableInRuntimeInspector]
106+
107+
[InspectorGroupEnd]
106108
public LidarModelPreset LidarModelPreset
107109
{
108110
get => m_lidarModelPreset;
@@ -127,6 +129,7 @@ public LidarModelPreset LidarModelPreset
127129
public IModelData ModelData { get; private set; } = new OusterData();
128130

129131
[SerializeField]
132+
[InspectorGroupBegin(Name="Local Frame Settings")]
130133
public GameObject LidarFrame;
131134

132135
private bool HasExplicitFrame() => LidarFrame != null;
@@ -135,14 +138,14 @@ public LidarModelPreset LidarModelPreset
135138
/// Local sensor rotation relative to the parent GameObject transform.
136139
/// </summary>
137140
[Tooltip("Local sensor rotation relative to the parent GameObject transform.")]
138-
[DynamicallyShowInInspector("HasExplicitFrame", true, true)]
141+
[DynamicallyShowInInspector(nameof(HasExplicitFrame), true, true)]
139142
public Vector3 LocalRotation = Vector3.zero;
140143

141144
/// <summary>
142145
/// Local sensor offset relative to the parent GameObject transform.
143146
/// </summary>
144147
[Tooltip("Local sensor offset relative to the parent GameObject transform.")]
145-
[DynamicallyShowInInspector("HasExplicitFrame", true, true)]
148+
[DynamicallyShowInInspector(nameof(HasExplicitFrame), true, true)]
146149
public Vector3 LocalPosition = Vector3.zero;
147150

148151
/// <summary>

0 commit comments

Comments
 (0)