示例#1
0
        private static void OutputStandardColor(
            List <byte[]> data,
            Data.Value.Enum <Data.StandardColorType> color,
            Data.Value.Color color_fixed,
            Data.Value.ColorWithRandom color_Random,
            Data.ColorEasingParamater color_Easing,
            Data.ColorFCurveParameter color_FCurve)
        {
            data.Add(color);

            if (color.Value == Data.StandardColorType.Fixed)
            {
                var color_all = (byte[])color_fixed;
                data.Add(color_all);
            }
            else if (color.Value == Data.StandardColorType.Random)
            {
                var color_random = (byte[])color_Random;
                data.Add(color_random);
            }
            else if (color.Value == Data.StandardColorType.Easing)
            {
                var easing = Utl.MathUtl.Easing((float)color_Easing.StartSpeed.Value, (float)color_Easing.EndSpeed.Value);
                data.Add((byte[])color_Easing.Start);
                data.Add((byte[])color_Easing.End);
                data.Add(BitConverter.GetBytes(easing[0]));
                data.Add(BitConverter.GetBytes(easing[1]));
                data.Add(BitConverter.GetBytes(easing[2]));
            }
            else if (color.Value == Data.StandardColorType.FCurve)
            {
                var bytes = color_FCurve.FCurve.GetBytes();
                data.Add(bytes);
            }
        }
示例#2
0
        private static void OutputStandardColor(
            List <byte[]> data,
            Data.Value.Enum <Data.StandardColorType> color,
            Data.Value.Color color_fixed,
            Data.Value.ColorWithRandom color_Random,
            Data.ColorEasingParamater color_Easing,
            Data.ColorFCurveParameter color_FCurve)
        {
            data.Add(color);

            if (color.Value == Data.StandardColorType.Fixed)
            {
                var color_all = (byte[])color_fixed;
                data.Add(color_all);
            }
            else if (color.Value == Data.StandardColorType.Random)
            {
                var color_random = (byte[])color_Random;
                data.Add(color_random);
            }
            else if (color.Value == Data.StandardColorType.Easing)
            {
                AddColorEasing(data, color_Easing);
            }
            else if (color.Value == Data.StandardColorType.FCurve)
            {
                var bytes = color_FCurve.FCurve.GetBytes();
                data.Add(bytes);
            }
        }
示例#3
0
        public static void OutputStandardColor(
            List <byte[]> data,
            Data.Value.Enum <Data.StandardColorType> color,
            Data.Value.Color color_fixed,
            Data.Value.ColorWithRandom color_Random,
            Data.ColorEasingParamater color_Easing,
            Data.ColorFCurveParameter color_FCurve,
            Data.Value.Gradient gradient = null)
        {
            var colorType = color.Value;

            if ((colorType == StandardColorType.FCurve && color_FCurve == null) ||
                (colorType == StandardColorType.Gradient && gradient == null))
            {
                colorType = StandardColorType.Fixed;
            }

            data.Add(((int)colorType).GetBytes());

            if (colorType == Data.StandardColorType.Fixed)
            {
                var color_all = (byte[])color_fixed;
                data.Add(color_all);
            }
            else if (color.Value == Data.StandardColorType.Random)
            {
                var color_random = (byte[])color_Random;
                data.Add(color_random);
            }
            else if (color.Value == Data.StandardColorType.Easing)
            {
                AddColorEasing(data, color_Easing);
            }
            else if (color.Value == Data.StandardColorType.FCurve)
            {
                var bytes = color_FCurve.FCurve.GetBytes();
                data.Add(bytes);
            }
            else if (color.Value == Data.StandardColorType.Gradient)
            {
                var bytes = gradient.ToBinary();
                data.Add(bytes);
            }
        }
示例#4
0
        public void SetBinding(object o)
        {
            var o_ = o as Data.Value.Enum <T>;

            Binding = o_;
        }
示例#5
0
        public static byte[] GetUVBytes(TextureInformation _TexInfo,
                                        Data.Value.Enum <Data.RendererCommonValues.UVType> _UVType,
                                        Data.RendererCommonValues.UVFixedParamater _Fixed,
                                        Data.RendererCommonValues.UVAnimationParamater _Animation,
                                        Data.RendererCommonValues.UVScrollParamater _Scroll,
                                        Data.RendererCommonValues.UVFCurveParamater _FCurve)
        {
            List <byte[]> data = new List <byte[]>();

            // sprcification change(1.5)
            float width  = 128.0f;
            float height = 128.0f;

            if (_TexInfo.Width > width && _TexInfo.Height > height)
            {
                width  = (float)_TexInfo.Width;
                height = (float)_TexInfo.Height;
            }

            data.Add(_UVType);
            if (_UVType == Data.RendererCommonValues.UVType.Default)
            {
            }
            else if (_UVType == Data.RendererCommonValues.UVType.Fixed)
            {
                var value_ = _Fixed;
                data.Add((value_.Start.X / width).GetBytes());
                data.Add((value_.Start.Y / height).GetBytes());
                data.Add((value_.Size.X / width).GetBytes());
                data.Add((value_.Size.Y / height).GetBytes());
            }
            else if (_UVType == Data.RendererCommonValues.UVType.Animation)
            {
                var value_ = _Animation;
                data.Add((value_.Start.X / width).GetBytes());
                data.Add((value_.Start.Y / height).GetBytes());
                data.Add((value_.Size.X / width).GetBytes());
                data.Add((value_.Size.Y / height).GetBytes());

                if (value_.FrameLength.Infinite)
                {
                    var inf = int.MaxValue / 100;
                    data.Add(inf.GetBytes());
                }
                else
                {
                    data.Add(value_.FrameLength.Value.Value.GetBytes());
                }

                data.Add(value_.FrameCountX.Value.GetBytes());
                data.Add(value_.FrameCountY.Value.GetBytes());
                data.Add(value_.LoopType);

                data.Add(value_.StartSheet.Max.GetBytes());
                data.Add(value_.StartSheet.Min.GetBytes());
            }
            else if (_UVType == Data.RendererCommonValues.UVType.Scroll)
            {
                var value_ = _Scroll;
                data.Add((value_.Start.X.Max / width).GetBytes());
                data.Add((value_.Start.Y.Max / height).GetBytes());
                data.Add((value_.Start.X.Min / width).GetBytes());
                data.Add((value_.Start.Y.Min / height).GetBytes());

                data.Add((value_.Size.X.Max / width).GetBytes());
                data.Add((value_.Size.Y.Max / height).GetBytes());
                data.Add((value_.Size.X.Min / width).GetBytes());
                data.Add((value_.Size.Y.Min / height).GetBytes());

                data.Add((value_.Speed.X.Max / width).GetBytes());
                data.Add((value_.Speed.Y.Max / height).GetBytes());
                data.Add((value_.Speed.X.Min / width).GetBytes());
                data.Add((value_.Speed.Y.Min / height).GetBytes());
            }
            else if (_UVType == Data.RendererCommonValues.UVType.FCurve)
            {
                {
                    var           value_ = _FCurve.Start;
                    var           bytes1 = value_.GetBytes(1.0f / width);
                    List <byte[]> _data  = new List <byte[]>();
                    data.Add(bytes1);
                }

                {
                    var           value_ = _FCurve.Size;
                    var           bytes1 = value_.GetBytes(1.0f / height);
                    List <byte[]> _data  = new List <byte[]>();
                    data.Add(bytes1);
                }
            }

            return(data.ToArray().ToArray());
        }