Esempio n. 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;
        }
Esempio n. 2
0
        private void RW_CreateNewPrimaryOrbEffect()
        {
            var obj = new GameObject().ClonePrefab("PrimaryOrbEffect", false);

            var effComp = obj.AddComponent <EffectComponent>();

            effComp.positionAtReferencedTransform = false;
            effComp.parentToReferencedTransform   = false;
            effComp.applyScale = false;
            effComp.soundName  = "";

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

            var vfxAtrib = obj.AddComponent <VFXAttributes>();

            vfxAtrib.vfxPriority  = VFXAttributes.VFXPriority.Always;
            vfxAtrib.vfxIntensity = VFXAttributes.VFXIntensity.Low;

            var rb = obj.AddComponent <Rigidbody>();

            rb.useGravity = false;

            var orbController = obj.AddComponent <WispOrbEffectController>();

            orbController.startSound     = "Play_wisp_active_loop";
            orbController.endSound       = "Stop_wisp_active_loop";
            orbController.explosionSound = "Play_item_use_fireballDash_explode";

            var arcCircle     = EffectHelper.AddArcaneCircle(obj, skin, MaterialType.ArcaneCircle, 2f, 0.65f);
            var arcCircleMain = arcCircle.main;

            arcCircleMain.duration = 10f;
            var arcCircleEmis = arcCircle.emission;

            arcCircleEmis.enabled          = true;
            arcCircleEmis.rateOverDistance = 0.1f;
            arcCircleEmis.burstCount       = 1;
            arcCircleEmis.SetBurst(0, new ParticleSystem.Burst(0f, 1, 1, 1));
            var arcCircleRol = arcCircle.rotationOverLifetime;

            arcCircleRol.enabled = true;
            arcCircleRol.z       = new ParticleSystem.MinMaxCurve(-3f, 3f);

            var sparks     = EffectHelper.AddSparks(obj, skin, MaterialType.Tracer, -1000, 0.125f, 1f);
            var sparksEmis = sparks.emission;

            sparksEmis.rateOverTime     = 0f;
            sparksEmis.rateOverDistance = 1f;
            var sparksShape = sparks.shape;

            sparksShape.enabled   = true;
            sparksShape.shapeType = ParticleSystemShapeType.Cone;
            sparksShape.angle     = 0f;
            sparksShape.radius    = 3f;
            var sparksNoise = sparks.noise;

            sparksNoise.enabled        = true;
            sparksNoise.quality        = ParticleSystemNoiseQuality.High;
            sparksNoise.scrollSpeed    = 1f;
            sparksNoise.positionAmount = 3f;


            primaryOrbEffect = obj;
            RegisterEffect(primaryOrbEffect);
        }