public override void OnInspectorGUI()
        {
            if (buttonStyle == null)
            {
                buttonStyle = new GUIStyle(EditorStyles.miniButtonRight)
                {
                    fixedWidth = 75
                }
            }
            ;

            urdfRobot = (UrdfRobot)target;

            GUILayout.Space(5);
            GUILayout.Label("All Rigidbodies", EditorStyles.boldLabel);
            DisplaySettingsToggle(new GUIContent("Is Kinematic"), urdfRobot.SetRigidbodiesIsKinematic);
            DisplaySettingsToggle(new GUIContent("Use Gravity"), urdfRobot.SetRigidbodiesUseGravity);
            DisplaySettingsToggle(new GUIContent("Use Inertia from URDF", "If disabled, Unity will generate new inertia tensor values automatically."),
                                  urdfRobot.SetUseUrdfInertiaData);

            GUILayout.Space(5);
            GUILayout.Label("All Colliders", EditorStyles.boldLabel);
            DisplaySettingsToggle(new GUIContent("Convex"), urdfRobot.SetCollidersConvex);

            GUILayout.Space(5);
            GUILayout.Label("All Joints", EditorStyles.boldLabel);
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Generate Unique Joint Names");
            if (GUILayout.Button("Generate", new GUIStyle(EditorStyles.miniButton)
            {
                fixedWidth = 155
            }))
            {
                urdfRobot.GenerateUniqueJointNames();
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(5);
            if (GUILayout.Button("Export robot to URDF file"))
            {
                // Get existing open window or if none, make a new one:
                UrdfExportEditorWindow window = (UrdfExportEditorWindow)EditorWindow.GetWindow(typeof(UrdfExportEditorWindow));
                window.urdfRobot = urdfRobot;
                window.minSize   = new Vector2(500, 200);
                window.GetEditorPrefs();
                window.Show();
            }
        }
Beispiel #2
0
 private static void CreateUrdfObject()
 {
     UrdfRobot.Create();
 }