/// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            thisTarget.threshold = VideoGlitchEditorHelper.IntSliderWithReset("Threshold", @"Strength of the effect.", Mathf.CeilToInt(thisTarget.threshold * 100.0f), 0, 100, 10) * 0.01f;

            thisTarget.maxOffset = VideoGlitchEditorHelper.IntSliderWithReset("Max offset", @"Max displacement.", Mathf.CeilToInt(thisTarget.maxOffset * 100.0f), 0, 100, 10) * 0.01f;

            thisTarget.thresholdYUV = VideoGlitchEditorHelper.IntSliderWithReset("Threshold YUV", @"Color change.", Mathf.CeilToInt(thisTarget.thresholdYUV * 100.0f), 0, 100, 50) * 0.01f;
        }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            thisTarget.distortionSteps = VideoGlitchEditorHelper.IntSliderWithReset("Distortion steps", @"Distortion steps.", (int)thisTarget.distortionSteps, 1, 10, 2);

            VideoGlitchEditorHelper.MinMaxSliderWithReset("Distortion range", @"Distortion range.", ref thisTarget.distortionAmountMinLimit, ref thisTarget.distortionAmountMaxLimit, 0.0f, 360.0f, 340.0f, 360.0f);

            thisTarget.distortionSpeed = VideoGlitchEditorHelper.SliderWithReset("Distortion speed", @"Distortion speed.", thisTarget.distortionSpeed, 0.0f, 10.0f, 1.0f);
        }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            thisTarget.strength = VideoGlitchEditorHelper.SliderWithReset(@"Strength", @"Effect strength [0 - 1].", thisTarget.strength, 0.0f, 1.0f, 0.5f);

            thisTarget.colorNoise = VideoGlitchEditorHelper.SliderWithReset(@"Color noise", @"Color noise [0 - 1].", thisTarget.colorNoise, 0.0f, 1.0f, 0.1f);

            thisTarget.noiseColor = EditorGUILayout.ColorField(@"Noise color", thisTarget.noiseColor);
        }
示例#4
0
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            thisTarget.strength = VideoGlitchEditorHelper.SliderWithReset(@"Strength", @"Corruption strength.", Mathf.CeilToInt(thisTarget.strength * 100.0f), 0, 100, 50) * 0.01f;

            thisTarget.speed = VideoGlitchEditorHelper.SliderWithReset(@"Speed", @"Distortion speed.", Mathf.CeilToInt(thisTarget.speed * 100.0f), 0, 100, 100) * 0.01f;

            thisTarget.tileSize = VideoGlitchEditorHelper.IntSliderWithReset(@"Tile size", @"Block size.", Mathf.FloorToInt(thisTarget.tileSize), 1, 128, 64);
        }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            thisTarget.impact = VideoGlitchEditorHelper.Vector2WithReset(@"Impact", @"Point of impact.", thisTarget.impact, Vector2.zero);

            thisTarget.distortion = VideoGlitchEditorHelper.SliderWithReset("Distortion", @"Image distortion [0.0 - 1.0].", thisTarget.distortion, 0.0f, 1.0f, 0.2f);

            EditorGUILayout.LabelField(@"Splits");

            EditorGUI.indentLevel++;

            thisTarget.splits = VideoGlitchEditorHelper.IntSliderWithReset("Count", @"Number of splits [1 - 100].", thisTarget.splits, 2, 100, 25);

            thisTarget.splitThreshold = VideoGlitchEditorHelper.SliderWithReset("Threshold", @"Split threshold [0.0 - 1.0].", thisTarget.splitThreshold, 0.0f, 1.0f, 0.5f);

            thisTarget.splitColor = VideoGlitchEditorHelper.ColorWithReset("Color", @"Split color.", thisTarget.splitColor, Color.gray);

            EditorGUI.indentLevel--;
        }
示例#6
0
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            EditorGUILayout.LabelField(@"Distortions");

            EditorGUI.indentLevel++;

            thisTarget.noise = VideoGlitchEditorHelper.SliderWithReset(@"Noise", @"Noise [0.0 - 1.0].", thisTarget.noise, 0.0f, 1.0f, 0.25f);

            thisTarget.waving = VideoGlitchEditorHelper.SliderWithReset(@"Waving", @"Wave strength [0.0 - 1.0].", thisTarget.waving, 0.0f, 1.0f, 0.5f);

            thisTarget.switchingNoise = VideoGlitchEditorHelper.SliderWithReset(@"Switching noise", @"Head switching noise [0.0 - 1.0].", thisTarget.switchingNoise, 0.0f, 1.0f, 0.5f);

            EditorGUI.indentLevel--;

            EditorGUILayout.LabelField(@"Stripes");

            EditorGUI.indentLevel++;

            thisTarget.stripeStrength = VideoGlitchEditorHelper.SliderWithReset(@"Strength", @"Stripes strength [0.0 - 1.0].", thisTarget.stripeStrength, 0.0f, 1.0f, 1.0f);
            thisTarget.stripeCount    = Mathf.Floor(VideoGlitchEditorHelper.SliderWithReset(@"Count", @"Stripes count [0 - 32].", thisTarget.stripeCount, 0.0f, 32.0f, 2.0f));
            thisTarget.stripeVelocity = VideoGlitchEditorHelper.SliderWithReset(@"Velocity", @"Stripes velocity [-10.0 - 10.0].", thisTarget.stripeVelocity, -10.0f, 10.0f, 1.2f);
            thisTarget.stripeNoise    = VideoGlitchEditorHelper.SliderWithReset(@"Noise", @"Stripes noise [0.0 - 1.0].", thisTarget.stripeNoise, 0.0f, 1.0f, 0.5f);

            EditorGUI.indentLevel--;

            EditorGUILayout.LabelField(@"AC Beat");

            EditorGUI.indentLevel++;

            thisTarget.acBeatWidth    = VideoGlitchEditorHelper.SliderWithReset(@"Width", @"Electrical ground loop interference width [0.0 - 1.0].", thisTarget.acBeatWidth, 0.0f, 1.0f, 0.6f);
            thisTarget.acBeatVelocity = VideoGlitchEditorHelper.SliderWithReset(@"Velocity", @"Electrical ground loop interference velocity [-10.0 - 10.0].", thisTarget.acBeatVelocity, -10.0f, 10.0f, 0.2f);

            EditorGUI.indentLevel--;

            thisTarget.bloomPasses = Mathf.Floor(VideoGlitchEditorHelper.SliderWithReset(@"Bloom passes", @"Bloom passes [0 - 10].", thisTarget.bloomPasses, 0.0f, 10.0f, 5.0f));
        }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            EditorGUILayout.LabelField(@"Slow scan");

            EditorGUI.indentLevel++;

            thisTarget.slowScan = VideoGlitchEditorHelper.SliderWithReset(@"Slow scan", "", thisTarget.slowScan, 0.0f, 1.0f, 0.01f);
            thisTarget.scanLine = VideoGlitchEditorHelper.SliderWithReset(@"Scanlines", "", thisTarget.scanLine, 0.0f, 2.0f, 0.5f);

            EditorGUI.indentLevel--;

            EditorGUILayout.LabelField(@"Vignette");

            EditorGUI.indentLevel++;

            thisTarget.vignetteSoftness  = VideoGlitchEditorHelper.SliderWithReset(@"Softness", "", thisTarget.vignetteSoftness, 0.0f, 1.0f, 0.9f);
            thisTarget.vignetteScale     = VideoGlitchEditorHelper.SliderWithReset(@"Scale", "", thisTarget.vignetteScale, 0.0f, 1.0f, 0.14f);
            thisTarget.vignetteTubeScale = VideoGlitchEditorHelper.SliderWithReset(@"Tube scale", "", thisTarget.vignetteTubeScale, 0.01f, 10.0f, 0.7f);

            EditorGUI.indentLevel--;

            EditorGUILayout.LabelField(@"Grain");

            EditorGUI.indentLevel++;

            thisTarget.grainSaturation = VideoGlitchEditorHelper.SliderWithReset(@"Saturation", "", thisTarget.grainSaturation, 0.0f, 1.0f, 0.0f);
            thisTarget.grainOpacity    = VideoGlitchEditorHelper.SliderWithReset(@"Strength", "", thisTarget.grainOpacity, 0.0f, 100.0f, 5.0f);

            EditorGUI.indentLevel--;

            EditorGUILayout.LabelField(@"Distortion");

            EditorGUI.indentLevel++;

            thisTarget.scanDistort = VideoGlitchEditorHelper.SliderWithReset(@"Scanline", "", thisTarget.scanDistort, 0.0f, 5.0f, 0.03f);
            thisTarget.timer       = VideoGlitchEditorHelper.SliderWithReset(@"Frequency", "", thisTarget.timer, 0.0f, 5.0f, 0.85f);
            thisTarget.speed       = VideoGlitchEditorHelper.SliderWithReset(@"Speed", "", thisTarget.speed, 0.0f, 5.0f, 0.85f);

            EditorGUI.indentLevel--;

            EditorGUILayout.LabelField(@"VHS Stripes");

            EditorGUI.indentLevel++;

            thisTarget.stripesCount   = VideoGlitchEditorHelper.SliderWithReset(@"Stripes", "", thisTarget.stripesCount, 0.0f, 1000.0f, 0.5f);
            thisTarget.stripesOpacity = VideoGlitchEditorHelper.SliderWithReset(@"Opacity", "", thisTarget.stripesOpacity, 0.0f, 10.0f, 1.0f);
            thisTarget.barsCount      = VideoGlitchEditorHelper.SliderWithReset(@"Bars", "", thisTarget.barsCount, 0.0f, 1000.0f, 5.0f);

            EditorGUI.indentLevel--;

            EditorGUILayout.LabelField(@"TV Tube Dots");

            EditorGUI.indentLevel++;

            thisTarget.tvDots      = VideoGlitchEditorHelper.IntSliderWithReset(@"Style", "", (int)thisTarget.tvDots, 0, 4, 1);
            thisTarget.tvDotsBlend = VideoGlitchEditorHelper.SliderWithReset(@"Stripes", "", thisTarget.tvDotsBlend, 0.0f, 1000.0f, 1.0f);

            EditorGUI.indentLevel--;

            EditorGUILayout.LabelField(@"Moire");

            EditorGUI.indentLevel++;

            thisTarget.moireOpacity = VideoGlitchEditorHelper.SliderWithReset(@"Gain", "", thisTarget.moireOpacity, 0.0f, 100.0f, 1.0f);
            thisTarget.moireScale   = VideoGlitchEditorHelper.SliderWithReset(@"Scale", "", thisTarget.moireScale, 0.01f, 100.0f, 0.15f);

            EditorGUI.indentLevel--;

            EditorGUILayout.LabelField(@"CRT Distortion");

            EditorGUI.indentLevel++;

            thisTarget.crtDistort = VideoGlitchEditorHelper.SliderWithReset(@"Tube distortion", "", thisTarget.crtDistort, 0.0f, 10.0f, 1.0f);
            thisTarget.crtScale   = VideoGlitchEditorHelper.SliderWithReset(@"Scale", "", thisTarget.crtScale, 1.0f, 10.0f, 1.06f);

            EditorGUI.indentLevel--;

            EditorGUILayout.LabelField(@"TV Lines");

            EditorGUI.indentLevel++;

            thisTarget.tvLines        = VideoGlitchEditorHelper.SliderWithReset(@"Lines", "", thisTarget.tvLines, 0.01f, 10.0f, 2.5f);
            thisTarget.tvLinesOpacity = VideoGlitchEditorHelper.SliderWithReset(@"Opacity", "", thisTarget.tvLinesOpacity, 0.0f, 10.0f, 1.0f);

            EditorGUI.indentLevel--;
        }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            thisTarget.strength = VideoGlitchEditorHelper.SliderWithReset("Strength", @"Effect strength.", thisTarget.strength, 0.0f, 1.0f, 0.1f);

            thisTarget.steps = VideoGlitchEditorHelper.IntSliderWithReset("Steps", @"Effect steps.", (int)thisTarget.steps, 3, 10, 5);
        }
示例#9
0
 /// <summary>
 /// Inspector.
 /// </summary>
 protected override void Inspector()
 {
     thisTarget.threshold = VideoGlitchEditorHelper.IntSliderWithReset("Threshold", @"Strength of the effect.", Mathf.CeilToInt(thisTarget.threshold * 100.0f), 0, 100, 100) * 0.01f;
 }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            thisTarget.amplitude = VideoGlitchEditorHelper.IntSliderWithReset("Amplitude", @"Offset amount.", Mathf.CeilToInt(thisTarget.amplitude * 100.0f), 0, 100, 100) * 0.01f;

            thisTarget.speed = (float)VideoGlitchEditorHelper.IntSliderWithReset(@"Speed", @"Speed of change.", Mathf.FloorToInt(thisTarget.speed * 500.0f), 0, 100, 10) * 0.002f;
        }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            thisTarget.noiseSpeed = VideoGlitchEditorHelper.SliderWithReset("Speed", @"Noise speed.", thisTarget.noiseSpeed, 0.0f, 100.0f, 100.0f);

            thisTarget.noiseAmplitude = VideoGlitchEditorHelper.SliderWithReset("Amplitude", @"Noise amplitude.", thisTarget.noiseAmplitude, 1.0f, 100.0f, 1.0f);
        }
示例#12
0
        /// <summary>
        /// OnInspectorGUI.
        /// </summary>
        public override void OnInspectorGUI()
        {
            if (baseTarget == null)
            {
                baseTarget = this.target as ImageEffectBase;
            }

            EditorGUIUtility.fieldWidth = 0.0f;

            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 = VideoGlitchEditorHelper.IntSliderWithReset(@"Amount", "The strength of the effect.\nFrom 0 (no effect) to 100 (full effect).", Mathf.RoundToInt(baseTarget.amount * 100.0f), 0, 100, 100) * 0.01f;

                    /////////////////////////////////////////////////
                    // Custom.
                    /////////////////////////////////////////////////
                    Inspector();

                    EditorGUILayout.Separator();

                    /////////////////////////////////////////////////
                    // Color.
                    /////////////////////////////////////////////////
                    foldoutColorControls = EditorGUILayout.Foldout(foldoutColorControls, "Color controls");
                    if (foldoutColorControls == true)
                    {
                        EditorGUI.indentLevel++;

                        baseTarget.brightness = VideoGlitchEditorHelper.IntSliderWithReset(@"Brightness", "The Screen appears to be more o less radiating light.\nFrom -100 (dark) to 100 (full light).", Mathf.RoundToInt(baseTarget.brightness * 100.0f), -100, 100, 0) * 0.01f;

                        baseTarget.contrast = VideoGlitchEditorHelper.IntSliderWithReset(@"Contrast", "The difference in color and brightness.\nFrom -100 (no constrast) to 100 (full constrast).", Mathf.RoundToInt(baseTarget.contrast * 100.0f), -100, 100, 0) * 0.01f;

                        baseTarget.gamma = VideoGlitchEditorHelper.SliderWithReset(@"Gamma", "Optimizes the contrast and brightness in the midtones.\nFrom 0.01 to 10.", baseTarget.gamma, 0.01f, 10.0f, 1.0f);

                        if (baseTarget.GetType() != typeof(VideoGlitchBlackWhiteDistortion))
                        {
                            EditorGUILayout.Separator();

                            baseTarget.saturation = VideoGlitchEditorHelper.SliderWithReset(@"Saturation", "Colorfulness. From 0.0 to 1.0", baseTarget.saturation, 0.0f, 1.0f, 1.0f);
                        }

                        EditorGUI.indentLevel--;
                    }

                    EditorGUILayout.Separator();

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

                    EditorGUILayout.BeginHorizontal();
                    {
                        if (GUILayout.Button(new GUIContent("[doc]", "Online documentation"), GUI.skin.label) == true)
                        {
                            Application.OpenURL(VideoGlitchEditorHelper.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 = "'Video Glitches' 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.fieldWidth = EditorGUIUtility.labelWidth = 0.0f;

            EditorGUI.indentLevel = 0;
        }
 /// <summary>
 /// Inspector.
 /// </summary>
 protected override void Inspector()
 {
     thisTarget.cellSize = VideoGlitchEditorHelper.IntSliderWithReset("Cell size", @"Cell size.", thisTarget.cellSize, 1, 10, 2);
 }