浏览代码

more rename

/develop/grid-vaiable-names
Ruo-Ping Dong 4 年前
当前提交
07b5c6dd
共有 4 个文件被更改,包括 17 次插入17 次删除
  1. 4
      com.unity.ml-agents.extensions/Editor/GridSensorComponentEditor.cs
  2. 20
      com.unity.ml-agents.extensions/Runtime/Sensors/GridSensorComponent.cs
  3. 6
      com.unity.ml-agents.extensions/Tests/Editor/Sensors/GridSensorTestUtils.cs
  4. 4
      com.unity.ml-agents.extensions/Tests/Utils/GridObsTestComponents/SimpleTestGridSensor.cs

4
com.unity.ml-agents.extensions/Editor/GridSensorComponentEditor.cs


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)
{

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);

20
com.unity.ml-agents.extensions/Runtime/Sensors/GridSensorComponent.cs


}
[HideInInspector, SerializeField]
internal int[] m_ChannelDepth = new int[] { 1 };
internal int[] m_ChannelDepths = new int[] { 1 };
public int[] ChannelDepth
public int[] ChannelDepths
get { return m_ChannelDepth; }
set { m_ChannelDepth = value; }
get { return m_ChannelDepths; }
set { m_ChannelDepths = value; }
}
[HideInInspector, SerializeField]

}
[HideInInspector, SerializeField]
internal LayerMask m_ObserveMask;
internal LayerMask m_ColliderMask;
public LayerMask ObserveMask
public LayerMask ColliderMask
get { return m_ObserveMask; }
set { m_ObserveMask = value; }
get { return m_ColliderMask; }
set { m_ColliderMask = value; }
}
[HideInInspector, SerializeField]

m_CellScale,
m_GridNum,
m_RotateWithAgent,
m_ChannelDepth,
m_ChannelDepths,
m_ObserveMask,
m_ColliderMask,
m_DepthType,
RootReference,
m_CompressionType,

6
com.unity.ml-agents.extensions/Tests/Editor/Sensors/GridSensorTestUtils.cs


}
public static void SetComponentParameters(GridSensorComponent gridComponent, string[] detectableObjects, int[] channelDepth, GridDepthType gridDepthType,
float cellScaleX, float cellScaleZ, int gridWidth, int gridHeight, int observeMaskInt, bool rotateWithAgent, Color[] debugColors)
float cellScaleX, float cellScaleZ, int gridWidth, int gridHeight, int colliderMaskInt, bool rotateWithAgent, Color[] debugColors)
gridComponent.ChannelDepth = channelDepth;
gridComponent.ChannelDepths = channelDepth;
gridComponent.ObserveMask = observeMaskInt;
gridComponent.ColliderMask = colliderMaskInt;
gridComponent.RotateWithAgent = rotateWithAgent;
gridComponent.DebugColors = debugColors;
}

4
com.unity.ml-agents.extensions/Tests/Utils/GridObsTestComponents/SimpleTestGridSensor.cs


CellScale,
GridNum,
RotateWithAgent,
ChannelDepth,
ChannelDepths,
ObserveMask,
ColliderMask,
DepthType,
RootReference,
CompressionType,

正在加载...
取消
保存