Пример #1
0
        public void ResetBrushSettings()
        {
            _brushAnimationCurve = new AnimationCurve();
            _brushAnimationCurve.AddKey(0f, 0);
            _brushAnimationCurve.AddKey(0.5f, 0.5f);
            _brushAnimationCurve.AddKey(1f, 0);

            _brushBezierVertexCount = 8;

            _brushEmissionReactOnAudio  = false;
            _brushEmissionBandBuffer    = 0;
            _brushEmissionEnabled       = false;
            _brushEmissionThreshold     = 0.1f;
            _brushEmissionFrequencyType = AudioFrequencyType.Band;

            _brushScaleReactOnAudio  = false;
            _brushScaleBandBuffer    = 0;
            _brushScaleMultiplier    = 1;
            _brushScaleThreshold     = 0.1f;
            _brushScaleFrequencyType = AudioFrequencyType.Band;

            _brushKochEnabled      = false;
            _brushTrailSpeedMinMax = Vector2.one;
            _brushTrailTimeMinMax  = Vector2.one;
            _brushTrailWidthMinMax = new Vector2(0.1f, 0.1f);
            _brushTrailEnabled     = false;
            _brushUseBezierCurves  = false;
            _brushStartGeneration  = new List <StartGen>
            {
                new StartGen()
                {
                    Guid     = Guid.NewGuid().ToString("N"),
                    Scale    = 1,
                    Outwards = false
                }
            };


            _brushDegree                 = 0;
            _brushScale                  = 0;
            _brushNumberStart            = 0;
            _brushStepSize               = 0;
            _brushMaxIterations          = 0;
            _brushUseLerping             = false;
            _brushLerpFrequencyType      = AudioFrequencyType.Band;
            _brushLerpAudioBand          = 0;
            _brushSpeedMinMax            = Vector2.one;
            _brushLerpInterpolationCurve = AnimationCurve.Constant(0, 1, 1);
            _brushRepeat                 = false;
            _brushInvert                 = false;

            _brushUseScaling = false;
            _brushScalePhylloFrequencyType = AudioFrequencyType.Band;
            _brushScaleAudioBand           = 0;
            _brushScaleMinMax             = Vector2.one;
            _brushUseScaleCurve           = false;
            _brushScaleInterpolationCurve = AnimationCurve.Constant(0, 1, 1);
            _brushInterpolationSpeed      = 0;
        }
Пример #2
0
        public void SetBrushFromCopy(LineModel lineModel)
        {
            _brushShape             = lineModel.Shape;
            _brushGradient          = lineModel.Gradient;
            _brushEmissionColor     = lineModel.EmissionColor;
            _brushEmissionIntensity = lineModel.EmissionIntensity;
            _brushWidthCurve        = lineModel.WidthCurve;
            _brushEmissionEnabled   = lineModel.IsEmissionEnabled;

            //Properties still not display in brush view (only edit view)
            _brushEmissionReactOnAudio  = lineModel.EmissionProperty.IsEmissionReactOnAudio;
            _brushEmissionBandBuffer    = lineModel.EmissionProperty.EmissionBandBuffer;
            _brushEmissionThreshold     = lineModel.EmissionProperty.EmissionThreshold;
            _brushEmissionFrequencyType = lineModel.EmissionProperty.EmissionFrequencyType;

            _brushScaleBandBuffer    = lineModel.ScaleProperty.ScaleBandBuffer;
            _brushScaleMultiplier    = lineModel.ScaleProperty.ScaleMultiplier;
            _brushScaleReactOnAudio  = lineModel.ScaleProperty.IsScaleReactOnAudio;
            _brushScaleThreshold     = lineModel.ScaleProperty.ScaleThreshold;
            _brushScaleFrequencyType = lineModel.ScaleProperty.ScaleFrequencyType;

            _brushKochEnabled       = lineModel.KochLineProperty.IsKochEnabled;
            _brushAnimationCurve    = lineModel.KochLineProperty.AnimationCurve;
            _brushBezierVertexCount = lineModel.KochLineProperty.BezierVertexCount;
            _brushKochAudioBand     = lineModel.KochLineProperty.KochAudioBand;
            _brushTrailSpeedMinMax  = lineModel.KochTrailProperty.TrailSpeedMinMax;
            _brushTrailTimeMinMax   = lineModel.KochTrailProperty.TrailTimeMinMax;
            _brushTrailWidthMinMax  = lineModel.KochTrailProperty.TrailWidthMinMax;
            _brushTrailEnabled      = lineModel.KochTrailProperty.IsTrailEnabled;
            _brushUseBezierCurves   = lineModel.KochLineProperty.UseBezierCurves;
            _brushStartGeneration   = lineModel.KochLineProperty.ListStartGeneration;

            _brushDegree                 = lineModel.PhyllotaxisProperty.Degree;
            _brushScale                  = lineModel.PhyllotaxisProperty.Scale;
            _brushNumberStart            = lineModel.PhyllotaxisProperty.NumberStart;
            _brushStepSize               = lineModel.PhyllotaxisProperty.StepSize;
            _brushMaxIterations          = lineModel.PhyllotaxisProperty.MaxIterations;
            _brushUseLerping             = lineModel.PhyllotaxisProperty.UseLerping;
            _brushLerpFrequencyType      = lineModel.PhyllotaxisProperty.LerpFrequencyType;
            _brushLerpAudioBand          = lineModel.PhyllotaxisProperty.LerpAudioBand;
            _brushSpeedMinMax            = lineModel.PhyllotaxisProperty.SpeedMinMax;
            _brushLerpInterpolationCurve = lineModel.PhyllotaxisProperty.LerpInterpolationCurve;
            _brushRepeat                 = lineModel.PhyllotaxisProperty.Repeat;
            _brushInvert                 = lineModel.PhyllotaxisProperty.Invert;

            _brushUseScaling = lineModel.PhyllotaxisProperty.UseScaling;
            _brushScalePhylloFrequencyType = lineModel.PhyllotaxisProperty.ScaleFrequencyType;
            _brushScaleAudioBand           = lineModel.PhyllotaxisProperty.ScaleAudioBand;
            _brushScaleMinMax             = lineModel.PhyllotaxisProperty.ScaleMinMax;
            _brushUseScaleCurve           = lineModel.PhyllotaxisProperty.UseScaleCurve;
            _brushScaleInterpolationCurve = lineModel.PhyllotaxisProperty.ScaleInterpolationCurve;
            _brushInterpolationSpeed      = lineModel.PhyllotaxisProperty.InterpolationSpeed;
        }