100 lines
4.1 KiB
C#
100 lines
4.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEditor;
|
|
|
|
//[CustomEditor(typeof(RobotManager))]
|
|
public class RobotManagerEditor : Editor
|
|
{
|
|
//RobotManager _target;
|
|
//SerializedProperty ControlRobot;
|
|
|
|
//private void OnEnable()
|
|
//{
|
|
// _target = (RobotManager)target;
|
|
// ControlRobot = serializedObject.FindProperty("ControlRobot");
|
|
//}
|
|
|
|
//int space_value = 2;
|
|
|
|
//public override void OnInspectorGUI()
|
|
//{
|
|
// serializedObject.Update();
|
|
|
|
// EditorGUILayout.PropertyField(ControlRobot);
|
|
// _target.Robot = EditorGUILayout.ObjectField(new GUIContent("机器人:"), _target.Robot, typeof(Robot), true) as Robot;
|
|
|
|
// #region 机器人控制
|
|
// EditorGUIUtility.labelWidth = 60;
|
|
// _target.idsValue[17] = EditorGUILayout.IntSlider("头_ID18", _target.idsValue[17], 0, 1000);
|
|
// _target.idsValue[16] = EditorGUILayout.IntSlider("颈_ID17", _target.idsValue[16], 0, 1000);
|
|
|
|
|
|
// EditorGUIUtility.labelWidth = 100;
|
|
// EditorGUILayout.BeginHorizontal();
|
|
// _target.idsValue[15] = EditorGUILayout.IntSlider("右肩旋转_ID16", _target.idsValue[15], 0, 1000);
|
|
// _target.idsValue[7] = EditorGUILayout.IntSlider("左肩旋转_ID8", _target.idsValue[7], 0, 1000);
|
|
// EditorGUILayout.EndHorizontal();
|
|
// EditorGUILayout.Space(space_value);
|
|
|
|
// EditorGUILayout.BeginHorizontal();
|
|
// _target.idsValue[14] = EditorGUILayout.IntSlider("右肩上下_ID15", _target.idsValue[14], 0, 1000);
|
|
// _target.idsValue[6] = EditorGUILayout.IntSlider("左肩上下_ID7", _target.idsValue[6], 0, 1000);
|
|
// EditorGUILayout.EndHorizontal();
|
|
// EditorGUILayout.Space(space_value);
|
|
|
|
|
|
// EditorGUILayout.BeginHorizontal();//镜像存在问题
|
|
// _target.idsValue[13] = EditorGUILayout.IntSlider("右小臂_ID14", _target.idsValue[13], 0, 1000);
|
|
// _target.idsValue[5] = EditorGUILayout.IntSlider("左小臂_ID6", _target.idsValue[5], 0, 1000);
|
|
// EditorGUILayout.EndHorizontal();
|
|
// EditorGUILayout.Space(space_value);
|
|
|
|
|
|
// EditorGUILayout.BeginHorizontal();
|
|
// _target.idsValue[12] = EditorGUILayout.IntSlider("右髋左右_ID13", _target.idsValue[12], 0, 1000);
|
|
// _target.idsValue[4] = EditorGUILayout.IntSlider("左髋左右_ID5", _target.idsValue[4], 0, 1000);
|
|
// EditorGUILayout.EndHorizontal();
|
|
// EditorGUILayout.Space(space_value);
|
|
|
|
|
|
// EditorGUILayout.BeginHorizontal();
|
|
// _target.idsValue[11] = EditorGUILayout.IntSlider("右髋前后_ID12", _target.idsValue[11], 0, 1000);
|
|
// _target.idsValue[3] = EditorGUILayout.IntSlider("左髋前后_ID4", _target.idsValue[3], 0, 1000);
|
|
// EditorGUILayout.EndHorizontal();
|
|
// EditorGUILayout.Space(space_value);
|
|
|
|
|
|
// EditorGUILayout.BeginHorizontal();
|
|
// _target.idsValue[10] = EditorGUILayout.IntSlider("右膝盖_ID11", _target.idsValue[10], 0, 1000);
|
|
// _target.idsValue[2] = EditorGUILayout.IntSlider("左膝盖_ID3", _target.idsValue[2], 0, 1000);
|
|
// EditorGUILayout.EndHorizontal();
|
|
// EditorGUILayout.Space(space_value);
|
|
|
|
|
|
// EditorGUILayout.BeginHorizontal();
|
|
// _target.idsValue[9] = EditorGUILayout.IntSlider("右脚踝前后_ID10", _target.idsValue[9], 0, 1000);
|
|
// _target.idsValue[1] = EditorGUILayout.IntSlider("左脚踝前后_ID2", _target.idsValue[1], 0, 1000);
|
|
// EditorGUILayout.EndHorizontal();
|
|
// EditorGUILayout.Space(space_value);
|
|
|
|
|
|
// EditorGUILayout.BeginHorizontal();
|
|
// _target.idsValue[8] = EditorGUILayout.IntSlider("右脚踝左右_ID9", _target.idsValue[8], 0, 1000);
|
|
// _target.idsValue[0] = EditorGUILayout.IntSlider("左脚踝左右_ID1", _target.idsValue[0], 0, 1000);
|
|
// EditorGUILayout.EndHorizontal();
|
|
// EditorGUILayout.Space(space_value);
|
|
// #endregion
|
|
|
|
// //for (int i = 0; i < _target.all_motions.Count; i++)
|
|
// //{
|
|
// // if (GUILayout.Button(_target.all_motions[i].motionName))
|
|
// // {
|
|
// // _target.Robot.UpdateMotions(_target.all_motions[i].motionList);
|
|
// // }
|
|
// //}
|
|
|
|
//serializedObject.ApplyModifiedProperties();
|
|
// }
|
|
}
|