示例#1
0
 private void UpdatePanelWithModel(GameObject module)
 {
     if (module != null)
     {
         UpdateModuleName(module.name);
         ModuleMotionController mmc = module.GetComponent <ModuleMotionController> ();
         panelJointDirectorFront.SetJointInfo(mmc, ModuleRefPointerController.PartNames.FrontWheel.ToString());
         panelJointDirectorLeft.SetJointInfo(mmc, ModuleRefPointerController.PartNames.LeftWheel.ToString());
         panelJointDirectorRight.SetJointInfo(mmc, ModuleRefPointerController.PartNames.RightWheel.ToString());
         panelJointDirectorCenter.SetJointInfo(mmc, ModuleRefPointerController.PartNames.Body.ToString());
     }
     else
     {
         ResetPanel();
     }
 }
 public void SetJointInfo(ModuleMotionController mmc, string name)
 {
     moduleMotionController = mmc;
     jointName = name;
     if (moduleMotionController.jointCommandObjectDict[jointName].commandType == JointCommandObject.CommandTypes.Velocity)
     {
         if (toggleCmdType != null)
         {
             toggleCmdType.isOn = true;
         }
     }
     else if (moduleMotionController.jointCommandObjectDict[jointName].commandType == JointCommandObject.CommandTypes.Position)
     {
         if (toggleCmdType != null)
         {
             toggleCmdType.isOn = false;
         }
     }
     if (inputFieldTime != null)
     {
         inputFieldTime.text = mmc.jointCommandObjectDict[jointName].period.ToString();
     }
     SetJointAngle(mmc.GetJointValue(jointName));
 }
 public void ResetJointInfo()
 {
     moduleMotionController = null;
     jointName = null;
     SetJointAngle(initialAngle);
 }