Пример #1
0
        /// <summary>
        /// Draws the field required to draw a VolumeInjectionParameters object
        /// </summary>
        /// <param name="injectionProperty">The related serialized property</param>
        /// <param name="displayMask">Int mask to display texture/noise mask</param>
        public static void DrawInjectionField(ref SerializedProperty injectionProperty, int displayMask)
        {
            SerializedProperty strengthProperty = injectionProperty.FindPropertyRelative("strength");

            GuiHelpers.DrawFloatField(ref strengthProperty, "Strength");

            if (displayMask == 1 || displayMask == 3)
            {
                EditorGUILayout.Separator();
                EditorGUILayout.BeginVertical();
                EditorGUILayout.LabelField("Texture Mask Levels", EditorStyles.boldLabel);
                SerializedProperty textureMaskLevelsProperty = injectionProperty.FindPropertyRelative("textureMaskLevelParameters");
                GuiHelpers.DrawLevelsField(ref textureMaskLevelsProperty);
                EditorGUILayout.EndVertical();
            }

            if (displayMask == 2 || displayMask == 3)
            {
                EditorGUILayout.Separator();
                EditorGUILayout.BeginVertical();
                EditorGUILayout.LabelField("Noise Mask Levels", EditorStyles.boldLabel);
                SerializedProperty noiseMaskLevelsProperty = injectionProperty.FindPropertyRelative("noiseMaskLevelParameters");
                GuiHelpers.DrawLevelsField(ref noiseMaskLevelsProperty);
                EditorGUILayout.EndVertical();
            }
        }