Unity 机器学习代理工具包 (ML-Agents) 是一个开源项目,它使游戏和模拟能够作为训练智能代理的环境。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

46 行
1.5 KiB

using UnityEditor;
using Unity.MLAgents.Integrations.Match3;
namespace Unity.MLAgents.Editor
{
[CustomEditor(typeof(Match3ActuatorComponent), editorForChildClasses: true)]
[CanEditMultipleObjects]
internal class Match3ActuatorComponentEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
var so = serializedObject;
so.Update();
var component = (Match3ActuatorComponent)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_ActuatorName"), true);
EditorGUILayout.PropertyField(so.FindProperty("m_RandomSeed"), true);
}
EditorGUI.EndDisabledGroup();
EditorGUILayout.PropertyField(so.FindProperty("m_ForceHeuristic"), true);
var requireSensorUpdate = EditorGUI.EndChangeCheck();
so.ApplyModifiedProperties();
if (requireSensorUpdate)
{
UpdateActuator();
}
}
void UpdateActuator()
{
}
}
}