浏览代码
Merge pull request #5020 from Unity-Technologies/fix-adding-name-field-to-var-len-obs-and-adding-to-changelog
Merge pull request #5020 from Unity-Technologies/fix-adding-name-field-to-var-len-obs-and-adding-to-changelog
Adding a SensorName field to BufferSensor/develop/gail-srl-hack
GitHub
4 年前
当前提交
766c4e27
共有 7 个文件被更改,包括 84 次插入 和 8 次删除
-
5Project/Assets/ML-Agents/Examples/Sorter/Prefabs/Area.prefab
-
1com.unity.ml-agents/CHANGELOG.md
-
8com.unity.ml-agents/Runtime/Sensors/BufferSensor.cs
-
31com.unity.ml-agents/Runtime/Sensors/BufferSensorComponent.cs
-
5com.unity.ml-agents/Tests/Editor/Sensor/BufferSensorTest.cs
-
31com.unity.ml-agents/Editor/BufferSensorComponentEditor.cs
-
11com.unity.ml-agents/Editor/BufferSensorComponentEditor.cs.meta
|
|||
using UnityEditor; |
|||
using Unity.MLAgents.Sensors; |
|||
|
|||
namespace Unity.MLAgents.Editor |
|||
{ |
|||
[CustomEditor(typeof(BufferSensorComponent))] |
|||
[CanEditMultipleObjects] |
|||
internal class BufferSensorComponentEditor : UnityEditor.Editor |
|||
{ |
|||
public override void OnInspectorGUI() |
|||
{ |
|||
var so = serializedObject; |
|||
so.Update(); |
|||
|
|||
// Drawing the BufferSensorComponent
|
|||
|
|||
EditorGUI.BeginDisabledGroup(!EditorUtilities.CanUpdateModelProperties()); |
|||
{ |
|||
// These fields affect the sensor order or observation size,
|
|||
// So can't be changed at runtime.
|
|||
EditorGUILayout.PropertyField(so.FindProperty("m_SensorName"), true); |
|||
EditorGUILayout.PropertyField(so.FindProperty("m_ObservableSize"), true); |
|||
EditorGUILayout.PropertyField(so.FindProperty("m_MaxNumObservables"), true); |
|||
} |
|||
EditorGUI.EndDisabledGroup(); |
|||
|
|||
so.ApplyModifiedProperties(); |
|||
} |
|||
|
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: b042fe65027f94c1eb38a2ee1362d38d |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue