Skip to content

Rename variables in Grid Sensor #5217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2308,16 +2308,16 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_SensorName: GridSensor
m_CellScale: {x: 1, y: 0.01, z: 1}
m_GridNumSide: {x: 40, y: 1, z: 40}
m_GridSize: {x: 40, y: 1, z: 40}
m_RotateWithAgent: 1
m_ChannelDepth: 06000000
m_ChannelDepths: 06000000
m_DetectableObjects:
- food
- agent
- wall
- badFood
- frozenAgent
m_ObserveMask:
m_ColliderMask:
serializedVersion: 2
m_Bits: 307
m_DepthType: 1
Expand Down Expand Up @@ -2653,16 +2653,16 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_SensorName: GridSensor
m_CellScale: {x: 1, y: 0.01, z: 1}
m_GridNumSide: {x: 40, y: 1, z: 40}
m_GridSize: {x: 40, y: 1, z: 40}
m_RotateWithAgent: 1
m_ChannelDepth: 06000000
m_ChannelDepths: 06000000
m_DetectableObjects:
- food
- agent
- wall
- badFood
- frozenAgent
m_ObserveMask:
m_ColliderMask:
serializedVersion: 2
m_Bits: 307
m_DepthType: 1
Expand Down Expand Up @@ -3003,16 +3003,16 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_SensorName: GridSensor
m_CellScale: {x: 1, y: 0.01, z: 1}
m_GridNumSide: {x: 40, y: 1, z: 40}
m_GridSize: {x: 40, y: 1, z: 40}
m_RotateWithAgent: 1
m_ChannelDepth: 06000000
m_ChannelDepths: 06000000
m_DetectableObjects:
- food
- agent
- wall
- badFood
- frozenAgent
m_ObserveMask:
m_ColliderMask:
serializedVersion: 2
m_Bits: 307
m_DepthType: 1
Expand Down Expand Up @@ -3622,16 +3622,16 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_SensorName: GridSensor
m_CellScale: {x: 1, y: 0.01, z: 1}
m_GridNumSide: {x: 40, y: 1, z: 40}
m_GridSize: {x: 40, y: 1, z: 40}
m_RotateWithAgent: 1
m_ChannelDepth: 06000000
m_ChannelDepths: 06000000
m_DetectableObjects:
- food
- agent
- wall
- badFood
- frozenAgent
m_ObserveMask:
m_ColliderMask:
serializedVersion: 2
m_Bits: 307
m_DepthType: 1
Expand Down Expand Up @@ -3958,16 +3958,16 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_SensorName: GridSensor
m_CellScale: {x: 1, y: 0.01, z: 1}
m_GridNumSide: {x: 40, y: 1, z: 40}
m_GridSize: {x: 40, y: 1, z: 40}
m_RotateWithAgent: 1
m_ChannelDepth: 06000000
m_ChannelDepths: 06000000
m_DetectableObjects:
- food
- agent
- wall
- badFood
- frozenAgent
m_ObserveMask:
m_ColliderMask:
serializedVersion: 2
m_Bits: 307
m_DepthType: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public override void OnInspectorGUI()
EditorGUILayout.LabelField("Grid Settings", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(so.FindProperty(nameof(GridSensorComponent.m_CellScale)), true);
// We only supports 2D GridSensor now so display gridNumSide as Vector2
var gridNumSide = so.FindProperty(nameof(GridSensorComponent.m_GridNumSide));
var gridNumSide2d = new Vector2Int(gridNumSide.vector3IntValue.x, gridNumSide.vector3IntValue.z);
var newGridNumSide = EditorGUILayout.Vector2IntField("Grid Num Side", gridNumSide2d);
gridNumSide.vector3IntValue = new Vector3Int(newGridNumSide.x, 1, newGridNumSide.y);
var gridSize = so.FindProperty(nameof(GridSensorComponent.m_GridSize));
var gridSize2d = new Vector2Int(gridSize.vector3IntValue.x, gridSize.vector3IntValue.z);
var newGridSize = EditorGUILayout.Vector2IntField("Grid Size", gridSize2d);
gridSize.vector3IntValue = new Vector3Int(newGridSize.x, 1, newGridSize.y);
EditorGUILayout.PropertyField(so.FindProperty(nameof(GridSensorComponent.m_RootReference)), true);
}
EditorGUI.EndDisabledGroup();
Expand All @@ -41,7 +41,7 @@ public override void OnInspectorGUI()
EditorGUILayout.PropertyField(so.FindProperty(nameof(GridSensorComponent.m_DepthType)), true);

// channel depth
var channelDepth = so.FindProperty(nameof(GridSensorComponent.m_ChannelDepth));
var channelDepth = so.FindProperty(nameof(GridSensorComponent.m_ChannelDepths));
var newDepth = EditorGUILayout.IntField("Channel Depth", channelDepth.arraySize);
if (newDepth != channelDepth.arraySize)
{
Expand Down Expand Up @@ -75,7 +75,7 @@ public override void OnInspectorGUI()
EditorGUILayout.PropertyField(so.FindProperty(nameof(GridSensorComponent.m_InitialColliderBufferSize)), true);
}
EditorGUI.EndDisabledGroup();
EditorGUILayout.PropertyField(so.FindProperty(nameof(GridSensorComponent.m_ObserveMask)), true);
EditorGUILayout.PropertyField(so.FindProperty(nameof(GridSensorComponent.m_ColliderMask)), true);
EditorGUI.BeginDisabledGroup(!EditorUtilities.CanUpdateModelProperties());
{
EditorGUILayout.LabelField("Sensor Settings", EditorStyles.boldLabel);
Expand Down
Loading