Beispiel #1
0
        public ParticleSystem.MinMaxGradient GetMinMaxGradient()
        {
            ParticleSystem.MinMaxGradient minMaxGradient = new ParticleSystem.MinMaxGradient();
            if (gradientMode.GetGradientMode() == ParticleSystemGradientMode.Color)
            {
                if (minMaxGradient.color == null)
                {
                    minMaxGradient.color = new Color();
                }
                minMaxGradient.color = color.GetColor();
            }

            if (gradientMode.GetGradientMode() == ParticleSystemGradientMode.TwoColors)
            {
                if (minMaxGradient.colorMax == null)
                {
                    minMaxGradient.colorMax = new Color();
                }
                minMaxGradient.colorMax = colorMax.GetColor();

                if (minMaxGradient.colorMin == null)
                {
                    minMaxGradient.colorMin = new Color();
                }
                minMaxGradient.colorMin = colorMin.GetColor();
            }

            if (gradientMode.GetGradientMode() == ParticleSystemGradientMode.Gradient)
            {
                if (minMaxGradient.gradient == null)
                {
                    minMaxGradient.gradient = new Gradient();
                }
                minMaxGradient.gradient.alphaKeys = gradientAlphaKeys.GetAlphaKeys();
                minMaxGradient.gradient.colorKeys = gradientColorKeys.GetColorKeys();
            }

            if (gradientMode.GetGradientMode() == ParticleSystemGradientMode.TwoGradients)
            {
                if (minMaxGradient.gradientMax == null)
                {
                    minMaxGradient.gradientMax = new Gradient();
                }
                minMaxGradient.gradientMax.alphaKeys = gradientMaxAlphaKeys.GetAlphaKeys();
                minMaxGradient.gradientMax.colorKeys = gradientMaxColorKeys.GetColorKeys();

                if (minMaxGradient.gradientMin == null)
                {
                    minMaxGradient.gradientMin = new Gradient();
                }
                minMaxGradient.gradientMin.alphaKeys = gradientMinAlphaKeys.GetAlphaKeys();
                minMaxGradient.gradientMin.colorKeys = gradientMinColorKeys.GetColorKeys();
            }

            minMaxGradient.mode = gradientMode.GetGradientMode();

            return(minMaxGradient);
        }
Beispiel #2
0
        public Gradient GetGradient()
        {
            Gradient gradient = new Gradient();

            gradient.alphaKeys = gradientAlphaKeys.GetAlphaKeys();
            gradient.colorKeys = gradientColorKeys.GetColorKeys();
            gradient.mode      = gradientMode.GetGradientMode();

            return(gradient);
        }