예제 #1
0
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            thisTarget.brightness = VintageEditorHelper.IntSliderWithReset("Brightness", VintageEditorHelper.TooltipBrightness, Mathf.RoundToInt(thisTarget.brightness * 100.0f), -100, 100, 0) * 0.01f;

            thisTarget.contrast = VintageEditorHelper.IntSliderWithReset("Contrast", VintageEditorHelper.TooltipContrast, Mathf.RoundToInt(thisTarget.contrast * 100.0f), -100, 100, 0) * 0.01f;

            thisTarget.gamma = VintageEditorHelper.SliderWithReset("Gamma", VintageEditorHelper.TooltipGamma, thisTarget.gamma, 0.01f, 10.0f, 1.0f);
        }
예제 #2
0
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            thisTarget.grainStrength = VintageEditorHelper.IntSliderWithReset(@"Grain strength", VintageEditorHelper.TooltipGrainStrength, Mathf.RoundToInt(thisTarget.grainStrength), 0, 100, 0);

            thisTarget.grainSize = VintageEditorHelper.IntSliderWithReset(@"Grain size", VintageEditorHelper.TooltipGrainSize, Mathf.RoundToInt(thisTarget.grainSize * 10000.0f), 0, 100, 50) * 0.0001f;

            thisTarget.blinkStrenght = VintageEditorHelper.IntSliderWithReset(@"Blink strength", VintageEditorHelper.TooltipBlinkStrength, Mathf.RoundToInt(thisTarget.blinkStrenght * 1000.0f), 0, 100, 0) * 0.001f;
        }
예제 #3
0
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
#if _SHOW_MAPS
            thisTarget.levelsTex = EditorGUILayout.ObjectField("Mapped", thisTarget.levelsTex, typeof(Texture2D), false) as Texture2D;
#endif

            thisTarget.obturation = VintageEditorHelper.IntSliderWithReset("Obturation", VintageEditorHelper.TooltipObturation, (int)(thisTarget.obturation * 50.0f), 0, 100, 50) * 0.02f;

            // Cheking errors.
            if (thisTarget.levelsTex == null)
            {
                this.Errors += VintageEditorHelper.ErrorTextureMissing;
            }
        }
예제 #4
0
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
#if _SHOW_MAPS
            thisTarget.blowoutTex = EditorGUILayout.ObjectField(@"BlowOut", thisTarget.blowoutTex, typeof(Texture2D), false) as Texture2D;
            thisTarget.overlayTex = EditorGUILayout.ObjectField(@"Overlay", thisTarget.overlayTex, typeof(Texture2D), false) as Texture2D;
            thisTarget.levelsTex  = EditorGUILayout.ObjectField(@"Mapped", thisTarget.levelsTex, typeof(Texture2D), false) as Texture2D;
#endif
            thisTarget.overlayStrength = VintageEditorHelper.IntSliderWithReset(@"Overlay", VintageEditorHelper.TooltipOverlay, (int)(thisTarget.overlayStrength * 100.0f), 0, 100, 50) * 0.01f;

            // Cheking errors.
            if (thisTarget.blowoutTex == null ||
                thisTarget.overlayTex == null ||
                thisTarget.levelsTex == null)
            {
                this.Errors += VintageEditorHelper.ErrorTextureMissing;
            }
        }
예제 #5
0
        /// <summary>
        /// OnInspectorGUI.
        /// </summary>
        public override void OnInspectorGUI()
        {
            if (baseTarget == null)
            {
                baseTarget = this.target as ImageEffectBase;
            }

            EditorGUIUtility.LookLikeControls();

            EditorGUI.indentLevel = 0;

            EditorGUIUtility.labelWidth = 125.0f;

            EditorGUILayout.BeginVertical();
            {
                EditorGUILayout.Separator();

#if (UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6)
                if (EditorGUIUtility.isProSkin == true)
#endif
                {
                    /////////////////////////////////////////////////
                    // Common.
                    /////////////////////////////////////////////////
                    baseTarget.amount = VintageEditorHelper.IntSliderWithReset("Amount", VintageEditorHelper.TooltipAmount, Mathf.RoundToInt(baseTarget.amount * 100.0f), 0, 100, 100) * 0.01f;

                    Inspector();

                    EditorGUILayout.Separator();

                    /////////////////////////////////////////////////
                    // Misc.
                    /////////////////////////////////////////////////

                    EditorGUILayout.BeginHorizontal();
                    {
                        if (GUILayout.Button(new GUIContent("[web]", "Open website"), GUI.skin.label) == true)
                        {
                            Application.OpenURL(VintageEditorHelper.DocumentationURL);
                        }

                        GUILayout.FlexibleSpace();

                        if (GUILayout.Button("Reset ALL") == true)
                        {
                            baseTarget.ResetDefaultValues();
                        }
                    }
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.Separator();
                }
#if (UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6)
                else
                {
                    this.Help   = string.Empty;
                    this.Errors = "'Vintage - Image Effects' require Unity Pro version!";
                }
#endif
                if (string.IsNullOrEmpty(Warnings) == false)
                {
                    EditorGUILayout.HelpBox(Warnings, MessageType.Warning);

                    EditorGUILayout.Separator();
                }

                if (string.IsNullOrEmpty(Errors) == false)
                {
                    EditorGUILayout.HelpBox(Errors, MessageType.Error);

                    EditorGUILayout.Separator();
                }

                if (string.IsNullOrEmpty(Help) == false)
                {
                    EditorGUILayout.HelpBox(Help, MessageType.Info);
                }
            }
            EditorGUILayout.EndVertical();

            Warnings = Errors = string.Empty;

            if (GUI.changed == true)
            {
                EditorUtility.SetDirty(target);
            }

            EditorGUIUtility.LookLikeControls();

            EditorGUI.indentLevel = 0;

            EditorGUIUtility.labelWidth = 125.0f;
        }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            thisTarget.hue = VintageEditorHelper.IntSliderWithReset("Hue", VintageEditorHelper.TooltipHue, Mathf.RoundToInt(thisTarget.hue * 360.0f), 0, 360, 0) / 360.0f;

            thisTarget.saturation = VintageEditorHelper.SliderWithReset("Saturation", VintageEditorHelper.TooltipSaturation, Mathf.RoundToInt(thisTarget.saturation * 100.0f), 0, 100, 100) * 0.01f;
        }