示例#1
0
        /// <summary>
        /// Blends a value in.
        /// </summary>
        /// <param name="self"><see langword="this"/>.</param>
        /// <param name="value">Value to blend in.</param>
        /// <param name="mode">Blend mode to use.</param>
        public static void BlendToValue(this CubismParameter self, CubismParameterBlendMode mode, float value)
        {
            if (mode == CubismParameterBlendMode.Additive)
            {
                self.AddToValue(value);


                return;
            }


            if (mode == CubismParameterBlendMode.Multiply)
            {
                self.MultiplyValueBy(value);


                return;
            }


            self.Value = value;
        }
        public static void BlendToValueWeight(this CubismParameter self, CubismParameterBlendMode mode, float value, float weight = 1f)
        {
            if (mode == CubismParameterBlendMode.Additive)
            {
                self.AddToValue(value, weight);


                return;
            }


            if (mode == CubismParameterBlendMode.Multiply)
            {
                self.MultiplyValueBy(value, weight);


                return;
            }


            self.SetToValue(value, weight);
        }