Ejemplo n.º 1
0
        /// <summary>
        /// Constructs a new set of GUI elements for inspecting the drive object.
        /// </summary>
        /// <param name="drive">Initial values to assign to the GUI elements.</param>
        /// <param name="layout">Layout to append the GUI elements to.</param>
        public D6JointDriveGUI(D6JointDrive drive, GUILayout layout)
        {
            driveData = drive.Data;

            stiffnessField.OnChanged += x => { driveData.stiffness = x; MarkAsModified(); };
            stiffnessField.OnFocusLost += ConfirmModify;
            stiffnessField.OnConfirmed += ConfirmModify;

            dampingField.OnChanged += x => { driveData.damping = x; MarkAsModified(); };
            dampingField.OnFocusLost += ConfirmModify;
            dampingField.OnConfirmed += ConfirmModify;

            forceLimitField.OnChanged += x => { driveData.forceLimit = x; MarkAsModified(); };
            forceLimitField.OnFocusLost += ConfirmModify;
            forceLimitField.OnConfirmed += ConfirmModify;

            accelerationField.OnChanged += x => { driveData.acceleration = x; MarkAsModified(); ConfirmModify(); };

            layout.AddElement(stiffnessField);
            layout.AddElement(dampingField);
            layout.AddElement(forceLimitField);
            layout.AddElement(accelerationField);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructs a new D6 joint drive.
 /// </summary>
 /// <param name="data">Properties to initialize the drive with.</param>
 public D6JointDrive(D6JointDriveData data)
 {
     this.data = data;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructs a new D6 joint drive.
 /// </summary>
 /// <param name="data">Properties to initialize the drive with.</param>
 public D6JointDrive(D6JointDriveData data)
 {
     this.data = data;
 }