浏览代码

Use AddComponentMenu for MonoBehaviours (#3231)

* Set AddComponentMenu for MonoBehaviours

* don't add Monitor

* pass componentOrder instead of nesting
/asymm-envs
GitHub 5 年前
当前提交
17b27d12
共有 9 个文件被更改,包括 23 次插入1 次删除
  1. 1
      UnitySDK/Assets/ML-Agents/Scripts/DemonstrationRecorder.cs
  2. 2
      UnitySDK/Assets/ML-Agents/Scripts/Policy/BehaviorParameters.cs
  3. 1
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensorComponent.cs
  4. 1
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/ISensor.cs
  5. 3
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/RayPerceptionSensorComponent2D.cs
  6. 1
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/RayPerceptionSensorComponent3D.cs
  7. 1
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensorComponent.cs
  8. 11
      UnitySDK/Assets/ML-Agents/Scripts/Constants.cs
  9. 3
      UnitySDK/Assets/ML-Agents/Scripts/Constants.cs.meta

1
UnitySDK/Assets/ML-Agents/Scripts/DemonstrationRecorder.cs


/// Demonstration Recorder Component.
/// </summary>
[RequireComponent(typeof(Agent))]
[AddComponentMenu("ML Agents/Demonstration Recorder", (int) MenuGroup.Default)]
public class DemonstrationRecorder : MonoBehaviour
{
public bool record;

2
UnitySDK/Assets/ML-Agents/Scripts/Policy/BehaviorParameters.cs


/// <summary>
/// The Factory to generate policies.
/// </summary>
///
[AddComponentMenu("ML Agents/Behavior Parameters", (int) MenuGroup.Default)]
public class BehaviorParameters : MonoBehaviour
{

1
UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensorComponent.cs


namespace MLAgents.Sensor
{
[AddComponentMenu("ML Agents/Camera Sensor", (int) MenuGroup.Sensors)]
public class CameraSensorComponent : SensorComponent
{
public new Camera camera;

1
UnitySDK/Assets/ML-Agents/Scripts/Sensor/ISensor.cs


return count;
}
}
}

3
UnitySDK/Assets/ML-Agents/Scripts/Sensor/RayPerceptionSensorComponent2D.cs


using UnityEngine;
[AddComponentMenu("ML Agents/Ray Perception Sensor 2D", (int) MenuGroup.Sensors)]
public class RayPerceptionSensorComponent2D : RayPerceptionSensorComponentBase
{
public override RayPerceptionSensor.CastType GetCastType()

1
UnitySDK/Assets/ML-Agents/Scripts/Sensor/RayPerceptionSensorComponent3D.cs


namespace MLAgents.Sensor
{
[AddComponentMenu("ML Agents/Ray Perception Sensor 3D", (int) MenuGroup.Sensors)]
public class RayPerceptionSensorComponent3D : RayPerceptionSensorComponentBase
{
[Header("3D Properties", order = 100)]

1
UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensorComponent.cs


namespace MLAgents.Sensor
{
[AddComponentMenu("ML Agents/Render Texture Sensor", (int) MenuGroup.Sensors)]
public class RenderTextureSensorComponent : SensorComponent
{
public RenderTexture renderTexture;

11
UnitySDK/Assets/ML-Agents/Scripts/Constants.cs


namespace MLAgents
{
/// <summary>
/// Grouping for use in AddComponentMenu (instead of nesting the menus).
/// </summary>
public enum MenuGroup
{
Default=0,
Sensors=50
}
}

3
UnitySDK/Assets/ML-Agents/Scripts/Constants.cs.meta


fileFormatVersion: 2
guid: 0622d88401ec464d9d2cf2fb03ce17b5
timeCreated: 1579215785
正在加载...
取消
保存