Exemplo n.º 1
0
        public void AssignTargetValues()
        {
            double lpX, lpY, lpZ, lrX, lrY, lrZ, lrW;

            ComputeLocalTransformation(XMotion.GetTargetValue(), YMotion.GetTargetValue(), ZMotion.GetTargetValue(), out lpX, out lpY, out lpZ, out lrX, out lrY, out lrZ, out lrW);
            transform.localPosition = new Vector3((float)lpX, (float)lpY, (float)lpZ);
            transform.localRotation = new Quaternion((float)lrX, (float)lrY, (float)lrZ, (float)lrW);
        }
Exemplo n.º 2
0
 private void DrawMotionInspector(Motion motion, string name)
 {
     using (var scope = new EditorGUILayout.VerticalScope("Box")) {
         EditorGUILayout.HelpBox(name, MessageType.None);
         motion.SetEnabled(EditorGUILayout.Toggle("Enabled", motion.IsEnabled()));
         if (motion.IsEnabled())
         {
             if (motion.Joint.GetJointType() != JointType.Continuous)
             {
                 motion.SetLowerLimit(EditorGUILayout.FloatField("Lower Limit", motion.GetLowerLimit()));
                 motion.SetUpperLimit(EditorGUILayout.FloatField("Upper Limit", motion.GetUpperLimit()));
             }
             motion.SetTargetValue(EditorGUILayout.Slider("Target Value", motion.GetTargetValue(), motion.GetLowerLimit(), motion.GetUpperLimit()));
         }
     }
 }