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); }
public void Start() { this.body = this.GetComponent <CharacterBody>(); this.eye1 = this.flare1.GetComponent <EyeFlare>(); this.eye2 = this.flare2.GetComponent <EyeFlare>(); //var skin = body.modelLocator.modelTransform.GetComponent<WispModelBitSkinController>(); var skin = WispBitSkin.GetWispSkin(this.body.skinIndex); this.flare1.color = skin.mainColor; this.flare2.color = skin.mainColor; this.flare1.material = skin.tracerMaterial; this.flare2.material = skin.tracerMaterial; }
private void Awake() { this.flareController = this.flare1.GetComponent <EyeFlare>(); }