private void RW_CreateNewSpecialBeam() { var obj = new GameObject().ClonePrefab("SpecialBeamEffect", false); var skin = obj.AddComponent <WispSkinnedEffect>(); var end = new GameObject("End").transform; end.parent = obj.transform; end.localPosition = Vector3.zero; end.localScale = Vector3.one; end.localRotation = Quaternion.identity; var beam = EffectHelper.SetupBeam(obj, end, 5f, 2.6f); var beamSparks = beam.AddParticles(EffectHelper.AddSparks(beam.gameObject, skin, MaterialType.Tracer, -10, 0.05f, 1f), true, true); var bsShape = beamSparks.shape; bsShape.enabled = true; bsShape.shapeType = ParticleSystemShapeType.ConeVolume; bsShape.angle = 0f; bsShape.radius = 0.25f; bsShape.length = 1f; bsShape.position = new Vector3(0f, 0f, 0f); var bsMain = beamSparks.main; bsMain.loop = true; bsMain.scalingMode = ParticleSystemScalingMode.Shape; bsMain.simulationSpace = ParticleSystemSimulationSpace.World; bsMain.maxParticles = 10000; bsMain.startSpeed = 0f; var bsNoise = beamSparks.noise; bsNoise.quality = ParticleSystemNoiseQuality.High; bsNoise.scrollSpeed = 10f; var beamLine = beam.AddBeamLine(skin, MaterialType.Beam, 0.25f, 0f, 0); specialBeam = obj; }
private void AW_SecondaryExplosion() { var obj = PrefabsCore.CreatePrefab("SecondaryExplosionEffect", false); var effComp = obj.AddComponent <EffectComponent>(); effComp.positionAtReferencedTransform = false; effComp.parentToReferencedTransform = false; effComp.applyScale = false; effComp.soundName = null; var skin = obj.AddComponent <WispSkinnedEffect>(); var vecScale = obj.AddComponent <EffectVectorScale>(); vecScale.effectComp = effComp; vecScale.applyX = true; vecScale.applyY = false; vecScale.applyZ = true; vecScale.durationFrac = 0f; vecScale.scaleOverTime = false; var vfxAtrib = obj.AddComponent <VFXAttributes>(); vfxAtrib.vfxPriority = VFXAttributes.VFXPriority.Always; vfxAtrib.vfxIntensity = VFXAttributes.VFXIntensity.Low; var timer = obj.AddComponent <DestroyOnTimer>(); timer.duration = 1f; var sounds = obj.AddComponent <EffectSoundPlayer>(); sounds.AddSound(new SoundEvent(0f, "Play_gravekeeper_attack2_shoot", 1f)); var flash1 = EffectHelper.AddFlash(obj, skin, MaterialType.Tracer); var flash1Main = flash1.main; flash1Main.scalingMode = ParticleSystemScalingMode.Local; var pillar = EffectHelper.AddFlamePillar(obj, skin, MaterialType.FlamePillar, 1000f, 3f, 0.75f); if (!this.AW_lowPerf.Value) { var sparks = EffectHelper.AddSparks(obj, skin, MaterialType.Tracer, 5000, 0.15f, 1.2f); var sparkMain = sparks.main; sparkMain.scalingMode = ParticleSystemScalingMode.Shape; sparkMain.maxParticles = 10000; var sparkShape = sparks.shape; sparkShape.enabled = true; sparkShape.shapeType = ParticleSystemShapeType.ConeVolume; sparkShape.angle = 0f; sparkShape.radius = 2f; sparkShape.length = 1000f; sparkShape.rotation = new Vector3(-90f, 0f, 0f); } var flashLines = EffectHelper.AddFlashLines(obj, skin, MaterialType.Tracer, 10, 0.2f); var flashLinesMain = flashLines.main; flashLinesMain.scalingMode = ParticleSystemScalingMode.Shape; var flashLineShape = flashLines.shape; flashLineShape.enabled = true; flashLineShape.shapeType = ParticleSystemShapeType.Cone; flashLineShape.radius = 1f; flashLineShape.length = 5f; flashLineShape.angle = 30f; flashLineShape.rotation = new Vector3(-90f, 0f, 0f); //var explosion = EffectHelper.AddExplosion( obj, skin, MaterialType.Explosion, 20, 0.3f, 5, 5f ); //var explShape = explosion.shape; //explShape.enabled = true; //explShape.shapeType = ParticleSystemShapeType.Hemisphere; //explShape.radius = 0.5f; //explShape.rotation = new Vector3( -90f, 0f, 0f ); if (!this.AW_lowPerf.Value) { var light = EffectHelper.AddLight(obj, skin, true, 20f, 100f); light.transform.localPosition += new Vector3(0f, 3f, 0f); EffectHelper.EditLightOverTime(light, 2f, AnimationCurve.EaseInOut(0f, 1f, 1f, 0f), AnimationCurve.EaseInOut(0f, 1f, 1f, 0f)); } if (!this.AW_lowPerf.Value) { var distortion = EffectHelper.AddDistortion(obj, skin, MaterialType.Distortion, 8f, 0.3f, 0f); } AW_secondaryExplosion = obj; RegisterEffect(AW_secondaryExplosion); }
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); }
private void RW_CreateNewSecondaryExplosion() { var obj = new GameObject().ClonePrefab("SecondaryExplosion", false); var effComp = obj.AddComponent <EffectComponent>(); effComp.positionAtReferencedTransform = false; effComp.parentToReferencedTransform = false; effComp.applyScale = false; effComp.soundName = "Play_item_use_meteor_impact"; var skin = obj.AddComponent <WispSkinnedEffect>(); var vfxAtrib = obj.AddComponent <VFXAttributes>(); vfxAtrib.vfxPriority = VFXAttributes.VFXPriority.Always; vfxAtrib.vfxIntensity = VFXAttributes.VFXIntensity.Low; var timer = obj.AddComponent <DestroyOnTimer>(); timer.duration = 4f; var flash1 = EffectHelper.AddFlash(obj, skin, MaterialType.Tracer); var pillar = EffectHelper.AddFlamePillar(obj, skin, MaterialType.FlamePillar, 20f, 4f, 0.35f, 8); var sparks = EffectHelper.AddSparks(obj, skin, MaterialType.Tracer, 100, 0.15f, 1.2f); var sparkShape = sparks.shape; sparkShape.enabled = true; sparkShape.shapeType = ParticleSystemShapeType.ConeVolume; sparkShape.angle = 0f; sparkShape.radius = 3.5f; sparkShape.length = 20f; sparkShape.rotation = new Vector3(-90f, 0f, 0f); var flashLines = EffectHelper.AddFlashLines(obj, skin, MaterialType.Tracer, 20, 0.2f); var flashLineShape = flashLines.shape; flashLineShape.enabled = true; flashLineShape.shapeType = ParticleSystemShapeType.Cone; flashLineShape.radius = 3.5f; flashLineShape.length = 5f; flashLineShape.angle = 30f; flashLineShape.rotation = new Vector3(-90f, 0f, 0f); var explosion = EffectHelper.AddExplosion(obj, skin, MaterialType.Explosion, 40, 0.2f, 5, 8f); var explShape = explosion.shape; explShape.enabled = true; explShape.shapeType = ParticleSystemShapeType.Hemisphere; explShape.radius = 0.75f; explShape.rotation = new Vector3(-90f, 0f, 0f); var light = EffectHelper.AddLight(obj, skin, true, 10f, 100f); light.transform.localPosition += new Vector3(0f, 3f, 0f); EffectHelper.EditLightOverTime(light, 2f, AnimationCurve.EaseInOut(0f, 1f, 1f, 0f), AnimationCurve.EaseInOut(0f, 1f, 1f, 0f)); var distortion = EffectHelper.AddDistortion(obj, skin, MaterialType.DistortionHeavy, 12f, 0.35f, 0.1f); var distEmis = distortion.emission; distEmis.burstCount = 1; distEmis.SetBurst(0, new ParticleSystem.Burst(0f, 1)); secondaryExplosion = obj; RegisterEffect(secondaryExplosion); }