示例#1
0
        /// <summary>
        /// Draws the fields required for a TransformParameters object
        /// </summary>
        /// <param name="transformProperty">The related serialized property</param>
        public static void DrawTransformField(ref SerializedProperty transformProperty)
        {
            EditorGUILayout.BeginHorizontal();
            SerializedProperty positionProperty = transformProperty.FindPropertyRelative("position");

            GUILayout.Label("Position", GuiStyles.Label, GUILayout.MaxWidth(160));
            GuiHelpers.DrawVector3Field(ref positionProperty);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Separator();

            EditorGUILayout.BeginHorizontal();
            SerializedProperty rotationProperty = transformProperty.FindPropertyRelative("rotation");

            GUILayout.Label("Rotation", GuiStyles.Label, GUILayout.MaxWidth(160));
            GuiHelpers.DrawVector3Field(ref rotationProperty);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Separator();

            EditorGUILayout.BeginHorizontal();
            SerializedProperty scaleProperty = transformProperty.FindPropertyRelative("scale");

            GUILayout.Label("Scale    ", GuiStyles.Label, GUILayout.MaxWidth(160));
            GuiHelpers.DrawVector3Field(ref scaleProperty);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Separator();

            SerializedProperty spaceProperty = transformProperty.FindPropertyRelative("space");

            GuiHelpers.DrawSpaceField(ref spaceProperty, "Space");
        }