public override void OnEnter() { base.OnEnter(); this.skinController = base.GetModelTransform().GetComponent <WispModelBitSkinController>(); var model = this.skinController.GetComponent <CharacterModel>(); this.bodyParticles = model.GetComponent <ParticleHolder>().systems[0]; this.flareSprite = base.gameObject.GetComponentInChildren <SpriteRenderer>(); this.eyeFlare = this.flareSprite.GetComponent <EyeFlare>(); this.eyeFlare.localScale = baseFlareIntensity; var emis = this.bodyParticles.emission; emis.rateOverTime = baseEmissionRate; base.characterBody.skinIndex = baseSkin; this.skinController.Apply(WispBitSkin.GetWispSkin(baseSkin)); this.flareSprite.color = this.skinController.activeLightColor; this.flareSprite.material = this.skinController.activeTracerMaterial; this.weaponStateMachine = base.outer.GetComponents <EntityStateMachine>().Where <EntityStateMachine>((esm) => esm.customName == "Weapon").Single <EntityStateMachine>(); }
public override void OnEnter() { base.OnEnter(); base.characterBody.AddBuff(BuffIndex.Immune); this.duration = transitionDuration; this.skinController = base.GetModelTransform().GetComponent <WispModelBitSkinController>(); var model = this.skinController.GetComponent <CharacterModel>(); var partHolder = model.GetComponent <ParticleHolder>(); this.bodyParticles = partHolder.systems[0]; this.flareSprite = base.gameObject.GetComponentInChildren <SpriteRenderer>(); this.eyeFlare = this.flareSprite.GetComponent <EyeFlare>(); var emis = this.bodyParticles.emission; this.initialParticleIntensity = emis.rateOverTime.constant; this.delayTime = this.duration * delayFrac; this.remainingTime = this.duration - this.delayTime; this.animationStartTime = this.duration * animationStartFrac; this.animationDuration = this.duration - this.animationStartTime; this.animationSoundPlayTime = animationSoundPlayFrac; this.animationParticleSurgeTime = this.animationStartTime + (this.animationDuration * animationParticleSurgeTimeFrac); }