示例#1
0
        private void AW_UtilityChargeEffect()
        {
            var obj = PrefabsCore.CreatePrefab("UtilityChargeEffect", false);

            var skinner = obj.AddComponent <WispSkinnedEffect>();

            if (!this.AW_lowPerf.Value)
            {
                var light = EffectHelper.AddLight(obj, skinner, true, 4f, 2f);
            }

            var chargeLines = EffectHelper.AddChargeSphereLines(obj, skinner, MaterialType.Tracer, 0.75f, 0.15f, 0.05f, 30f);

            var arcCircle = EffectHelper.AddArcaneCircle(obj, skinner, MaterialType.ArcaneCircle, 5f, 2f);
            var arcMain   = arcCircle.main;

            arcMain.simulationSpace     = ParticleSystemSimulationSpace.Local;
            arcMain.emitterVelocityMode = ParticleSystemEmitterVelocityMode.Transform;
            var arcEmis = arcCircle.emission;

            arcEmis.burstCount = 1;
            arcEmis.SetBurst(0, new ParticleSystem.Burst(0f, 1f, 1, 0.01f));
            var arcShape = arcCircle.shape;

            arcShape.enabled = false;
            var arcCOL = arcCircle.colorOverLifetime;

            arcCOL.enabled = true;
            arcCOL.color   = new ParticleSystem.MinMaxGradient(new Gradient
            {
                mode      = GradientMode.Blend,
                alphaKeys = new[]
                {
                    new GradientAlphaKey(0f, 0f),
                    new GradientAlphaKey(1f, 1f),
                },
                colorKeys = new[]
                {
                    new GradientColorKey(Color.white, 0f),
                    new GradientColorKey(Color.white, 0f),
                },
            });
            var arcSOL = arcCircle.sizeOverLifetime;

            arcSOL.enabled      = true;
            arcSOL.separateAxes = false;
            arcSOL.size         = new ParticleSystem.MinMaxCurve(1f, AnimationCurve.Linear(0f, 1f, 1f, 0f));
            var arcROL = arcCircle.rotationOverLifetime;

            arcROL.enabled = true;
            arcROL.z       = 2f;



            AW_utilityChargeEffect = obj;
        }