Пример #1
0
            public override void OnInspectorGUI()
            {
                Undo.RecordObject(Target, Target.name);

                using (var scope = new EditorGUILayout.VerticalScope("Button")) {
                    EditorGUILayout.HelpBox("Geometry", MessageType.None);
                    Target.Type            = (JointType)EditorGUILayout.EnumPopup("Type", Target.Type);
                    Target.Connection      = EditorGUILayout.Vector3Field("Connection", Target.Connection);
                    Target.AxisOrientation = EditorGUILayout.Vector3Field("Axis Orientation", Target.AxisOrientation);
                }

                using (var scope = new EditorGUILayout.VerticalScope("Button")) {
                    Target.AnimationWeight = EditorGUILayout.Slider("Animation Weight", Target.AnimationWeight, 0f, 1f);;
                }

                DrawMotionInspector(Target.XMotion, "X Motion");
                DrawMotionInspector(Target.YMotion, "Y Motion");
                DrawMotionInspector(Target.ZMotion, "Z Motion");

                //EditorGUILayout.HelpBox("X Axis: " + Target.ComputeXAxis().ToString("F3") + "\nY Axis: " + Target.ComputeYAxis().ToString("F3") + "\nZ Axis: " + Target.ComputeZAxis().ToString("F3"), MessageType.None);
                EditorGUILayout.HelpBox(
                    "Current Value: " + Target.GetCurrentValue().ToString("F3") + "\n" +
                    "Current Error: " + Target.GetCurrentError().ToString("F3") + "\n" +
                    "Current Velocity: " + Target.GetCurrentVelocity().ToString("F3") + "\n" +
                    "Current Acceleration: " + Target.GetCurrentAcceleration().ToString("F3"), MessageType.None);

                EditorUtility.SetDirty(Target);
            }