Example #1
0
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            if (effect == null)
            {
                effect = this.target as SpriteColorRampMask;
            }

            EditorGUIUtility.fieldWidth = 40.0f;

            effect.palettes[0] = (SpriteColorRampPalettes)EditorGUILayout.EnumPopup(@"Palette 1 (Red)", effect.palettes[0]);

            effect.palettes[1] = (SpriteColorRampPalettes)EditorGUILayout.EnumPopup(@"Palette 2 (Green)", effect.palettes[1]);

            effect.palettes[2] = (SpriteColorRampPalettes)EditorGUILayout.EnumPopup(@"Palette 3 (Blue)", effect.palettes[2]);

            effect.strength = SpriteColorFXEditorHelper.IntSliderWithReset(@"Strength", SpriteColorFXEditorHelper.TooltipStrength, Mathf.RoundToInt(effect.strength * 100.0f), 0, 100, 100) * 0.01f;

            effect.gammaCorrect = SpriteColorFXEditorHelper.SliderWithReset(@"Gamma", SpriteColorFXEditorHelper.TooltipGamma, effect.gammaCorrect, 0.5f, 3.0f, 1.2f);

            effect.uvScroll = SpriteColorFXEditorHelper.SliderWithReset(@"UV Scroll", SpriteColorFXEditorHelper.TooltipUVScroll, effect.uvScroll, 0.0f, 1.0f, 0.0f);

            EditorGUIUtility.fieldWidth = 60.0f;

            SpriteColorFXEditorHelper.MinMaxSliderWithReset(@"Luminance range", SpriteColorFXEditorHelper.TooltipLuminanceRange, ref effect.luminanceRangeMin, ref effect.luminanceRangeMax, 0.0f, 1.0f, 0.0f, 1.0f);

            effect.invertLum = SpriteColorFXEditorHelper.ToogleWithReset(@"Invert luminance", SpriteColorFXEditorHelper.TooltipInvertLuminance, effect.invertLum, false);

            effect.textureMask = EditorGUILayout.ObjectField(new GUIContent(@"Mask (RGBA)", SpriteColorFXEditorHelper.TooltipTextureMask), effect.textureMask, typeof(Texture2D), false) as Texture2D;
        }
Example #2
0
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            if (baseTarget == null)
            {
                baseTarget = this.target as SpriteColorShiftRadial;
            }

            EditorGUIUtility.fieldWidth = 40.0f;

            baseTarget.strength = SpriteColorFXEditorHelper.IntSliderWithReset(@"Strength", SpriteColorFXEditorHelper.TooltipStrength, Mathf.RoundToInt(baseTarget.strength * 100.0f), 0, 100, 0) * 0.01f;

            baseTarget.noiseAmount = SpriteColorFXEditorHelper.SliderWithReset(@"Noise amount", SpriteColorFXEditorHelper.TooltipNoiseAmount, baseTarget.noiseAmount * 100.0f, 0.0f, 100.0f, 0.0f) * 0.01f;

            baseTarget.noiseSpeed = SpriteColorFXEditorHelper.SliderWithReset(@"Noise speed", SpriteColorFXEditorHelper.TooltipNoiseSpeed, baseTarget.noiseSpeed * 100.0f, 0.0f, 100.0f, 0.0f) * 0.01f;
        }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            if (baseTarget == null)
            {
                baseTarget = base.target as SpriteColorBlend;
            }

            EditorGUIUtility.fieldWidth = 40.0f;

            baseTarget.strength = (float)SpriteColorFXEditorHelper.IntSliderWithReset(@"Strength", SpriteColorFXEditorHelper.TooltipStrength, Mathf.RoundToInt(baseTarget.strength * 100.0f), 0, 100, 100) * 0.01f;

            SpriteColorHelper.PixelOp newPixelOp = (SpriteColorHelper.PixelOp)EditorGUILayout.EnumPopup(new GUIContent(@"Blend mode", @"Blend modes"), baseTarget.pixelOp);
            if (newPixelOp != baseTarget.pixelOp)
            {
                baseTarget.SetPixelOp(newPixelOp);
            }
        }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            if (effect == null)
            {
                effect = this.target as SpriteColorRamp;
            }

            EditorGUIUtility.fieldWidth = 40.0f;

            effect.palette = (SpriteColorRampPalettes)EditorGUILayout.EnumPopup(@"Palette", effect.palette);

            effect.strength = SpriteColorFXEditorHelper.IntSliderWithReset(@"Strength", SpriteColorFXEditorHelper.TooltipStrength, Mathf.RoundToInt(effect.strength * 100.0f), 0, 100, 100) * 0.01f;

            effect.gammaCorrect = SpriteColorFXEditorHelper.SliderWithReset(@"Gamma", SpriteColorFXEditorHelper.TooltipGamma, effect.gammaCorrect, 0.5f, 3.0f, 1.2f);

            effect.uvScroll = SpriteColorFXEditorHelper.SliderWithReset(@"UV Scroll", SpriteColorFXEditorHelper.TooltipUVScroll, effect.uvScroll, 0.0f, 1.0f, 0.0f);

            EditorGUIUtility.fieldWidth = 60.0f;

            SpriteColorFXEditorHelper.MinMaxSliderWithReset(@"Luminance range", SpriteColorFXEditorHelper.TooltipLuminanceRange, ref effect.luminanceRangeMin, ref effect.luminanceRangeMax, 0.0f, 1.0f, 0.0f, 1.0f);

            effect.invertLum = SpriteColorFXEditorHelper.ToogleWithReset(@"Invert luminance", SpriteColorFXEditorHelper.TooltipInvertLuminance, effect.invertLum, false);
        }
        /// <summary>
        /// Inspector.
        /// </summary>
        protected override void Inspector()
        {
            if (baseTarget == null)
            {
                baseTarget = base.target as SpriteColorMasks3;
            }

            EditorGUIUtility.fieldWidth = 40.0f;

            baseTarget.strength = (float)SpriteColorFXEditorHelper.IntSliderWithReset(@"Strength", SpriteColorFXEditorHelper.TooltipStrength, Mathf.RoundToInt(baseTarget.strength * 100.0f), 0, 100, 100) * 0.01f;

            SpriteColorHelper.PixelOp newPixelOp = (SpriteColorHelper.PixelOp)EditorGUILayout.EnumPopup(new GUIContent(@"Blend mode", @"Blend modes"), baseTarget.pixelOp);
            if (newPixelOp != baseTarget.pixelOp)
            {
                baseTarget.SetPixelOp(newPixelOp);
            }

            EditorGUILayout.LabelField(@"#1 mask (red)");
            {
                EditorGUI.indentLevel++;

                baseTarget.strengthMaskRed = (float)SpriteColorFXEditorHelper.IntSliderWithReset(@"Strength", SpriteColorFXEditorHelper.TooltipStrength, Mathf.RoundToInt(baseTarget.strengthMaskRed * 100f), 0, 100, 100) * 0.01f;

                baseTarget.colorMaskRed = EditorGUILayout.ColorField(@"Color", baseTarget.colorMaskRed);

                baseTarget.textureMaskRed = (EditorGUILayout.ObjectField(new GUIContent(@"Texture (RGB)", SpriteColorFXEditorHelper.TooltipTextureMask), baseTarget.textureMaskRed, typeof(Texture2D), false, GUILayout.Height(54.0f)) as Texture2D);
                if (baseTarget.textureMaskRed != null)
                {
                    EditorGUILayout.LabelField(@"UV params");

                    UVParamsInspectorGUI(ref baseTarget.textureMaskRedUVParams, ref baseTarget.textureMaskRedUVAngle);
                }

                EditorGUI.indentLevel--;
            }

            EditorGUILayout.LabelField(@"#2 mask (green)");
            {
                EditorGUI.indentLevel++;

                baseTarget.strengthMaskGreen = (float)SpriteColorFXEditorHelper.IntSliderWithReset(@"Strength", SpriteColorFXEditorHelper.TooltipStrength, Mathf.RoundToInt(baseTarget.strengthMaskGreen * 100f), 0, 100, 100) * 0.01f;

                baseTarget.colorMaskGreen = EditorGUILayout.ColorField(@"Color", baseTarget.colorMaskGreen);

                baseTarget.textureMaskGreen = (EditorGUILayout.ObjectField(new GUIContent(@"Texture (RGB)", SpriteColorFXEditorHelper.TooltipTextureMask), baseTarget.textureMaskGreen, typeof(Texture2D), false, GUILayout.Height(54.0f)) as Texture2D);
                if (baseTarget.textureMaskGreen != null)
                {
                    EditorGUILayout.LabelField(@"UV params");

                    UVParamsInspectorGUI(ref baseTarget.textureMaskGreenUVParams, ref baseTarget.textureMaskGreenUVAngle);
                }

                EditorGUI.indentLevel--;
            }

            EditorGUILayout.LabelField(@"#3 mask (blue)");
            {
                EditorGUI.indentLevel++;

                baseTarget.strengthMaskBlue = (float)SpriteColorFXEditorHelper.IntSliderWithReset(@"Strength", SpriteColorFXEditorHelper.TooltipStrength, Mathf.RoundToInt(baseTarget.strengthMaskBlue * 100f), 0, 100, 100) * 0.01f;

                baseTarget.colorMaskBlue = EditorGUILayout.ColorField(@"Color", baseTarget.colorMaskBlue);

                baseTarget.textureMaskBlue = (EditorGUILayout.ObjectField(new GUIContent(@"Texture (RGB)", SpriteColorFXEditorHelper.TooltipTextureMask), baseTarget.textureMaskBlue, typeof(Texture2D), false, GUILayout.Height(54.0f)) as Texture2D);
                if (baseTarget.textureMaskBlue != null)
                {
                    EditorGUILayout.LabelField(@"UV params");

                    UVParamsInspectorGUI(ref baseTarget.textureMaskBlueUVParams, ref baseTarget.textureMaskBlueUVAngle);
                }

                EditorGUI.indentLevel--;
            }

            EditorGUILayout.Separator();

            baseTarget.textureMask = (EditorGUILayout.ObjectField(new GUIContent(@"Mask #1 (RGB)", SpriteColorFXEditorHelper.TooltipTextureMask), this.baseTarget.textureMask, typeof(Texture2D), false, GUILayout.Height(54.0f)) as Texture2D);
        }