Download com.unity.ml-agents/Editor/Match3SensorComponentEditor.cs from ashish2244/ppo-SnowballTarget: direct link, hf CLI and curl.
- Browser
- Download file 1.43 kB
-
https://huggingface.co/ashish2244/ppo-SnowballTarget/resolve/main/com.unity.ml-agents/Editor/Match3SensorComponentEditor.cs
- Command line
-
hf download hf://ashish2244/ppo-SnowballTarget/com.unity.ml-agents/Editor/Match3SensorComponentEditor.cs
-
curl -L -o Match3SensorComponentEditor.cs https://huggingface.co/ashish2244/ppo-SnowballTarget/resolve/main/com.unity.ml-agents/Editor/Match3SensorComponentEditor.cs
1.43 kB
| using UnityEditor; | |
| using Unity.MLAgents.Integrations.Match3; | |
| namespace Unity.MLAgents.Editor | |
| { | |
| [] | |
| [] | |
| internal class Match3SensorComponentEditor : UnityEditor.Editor | |
| { | |
| public override void OnInspectorGUI() | |
| { | |
| var so = serializedObject; | |
| so.Update(); | |
| var component = (Match3SensorComponent)target; | |
| var board = component.GetComponent<AbstractBoard>(); | |
| if (board == null) | |
| { | |
| EditorGUILayout.HelpBox("You must provide an implementation of an AbstractBoard.", MessageType.Warning); | |
| return; | |
| } | |
| // Drawing the RenderTextureComponent | |
| EditorGUI.BeginChangeCheck(); | |
| EditorGUI.BeginDisabledGroup(!EditorUtilities.CanUpdateModelProperties()); | |
| { | |
| EditorGUILayout.PropertyField(so.FindProperty("m_SensorName"), true); | |
| EditorGUILayout.PropertyField(so.FindProperty("m_ObservationType"), true); | |
| } | |
| EditorGUI.EndDisabledGroup(); | |
| var requireSensorUpdate = EditorGUI.EndChangeCheck(); | |
| so.ApplyModifiedProperties(); | |
| if (requireSensorUpdate) | |
| { | |
| UpdateSensor(); | |
| } | |
| } | |
| void UpdateSensor() | |
| { | |
| } | |
| } | |
| } | |