示例#1
0
            public Splatter([NotNull] ParticleWetSplatter splatters, [NotNull] DecalSettings settings)
            {
                _splatters = splatters;

                _settings         = new DecalSettingsSaturationProxy(settings);
                settings.Changed += DecalSettingsChanged;
            }
示例#2
0
            private static void AutoConfigureSplatter([NotNull] ParticleWetSplatter splatter, [NotNull] Transform start, [NotNull] Transform end)
            {
                splatter.Core.DecalSize      = new Vector3(0.1f, 0.1f, 0.1f);
                splatter.Core.VerticalOffset = -0.025f;
                splatter.Core.DecalChance    = 0.5f;
                splatter.Core.Saturation     = 0.75f;

                splatter.Limit.Enabled     = true;
                splatter.Limit.MaxDecals   = (int)Mathf.Ceil(Vector3.Distance(end.position, start.position) * 35);
                splatter.Limit.DecalChance = new AnimationCurve(new Keyframe(0, 0.5f), new Keyframe(1, 0.25f));

                splatter.Lifetime.Enabled     = true;
                splatter.Lifetime.MaxLifetime = 100;
                splatter.Lifetime.MinLifetime = 50;
                splatter.Lifetime.Saturation  = new AnimationCurve(new Keyframe(0, 1), new Keyframe(0.5f, 1), new Keyframe(1, 0));

                splatter.Recycling.Enabled = true;
                splatter.Recycling.MaxAcceleratedAgeing = 5;
                splatter.Recycling.StealThreshold       = splatter.Core.DecalSize.x * splatter.Core.DecalSize.z * 0.5f;

                splatter.RandomizeSize.Enabled      = true;
                splatter.RandomizeSize.MinInflation = 0.75f;
                splatter.RandomizeSize.MaxInflation = 1.25f;

                splatter.ImpactVelocity.Enabled = false;
            }