Esempio n. 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");
        }
Esempio n. 2
0
 /// <summary>
 /// Draws a Vector3 field
 /// </summary>
 /// <param name="vector3Property">The related serialized property</param>
 public static void DrawVector3Field(ref SerializedProperty vector3Property)
 {
     GuiHelpers.DrawVector3Field(ref vector3Property, null);
 }