void Awake() { door1 = gameObject.FindInChildren("Door1").transform; door2 = gameObject.FindInChildren("Door2").transform; grate = gameObject.FindInChildren("Grate").transform; fireEffect = GetComponentInChildren <VFXOneOff>(); damager.Set(damagePerSecond, DamagerType.FireTrap, Vector3.up); //_damageVolume = GetComponent<Collider>(); if (mode == Mode.ContinuousStream) { Open(); } }
public void SetPulseProjectileStats(float newScaleRate, float newMaxScale, float newDamage) { scaleRate = newScaleRate; maxScale = newMaxScale; damage = newDamage; VFXOneOff vfx = ps.GetComponent <VFXOneOff>(); vfx.Stop(); ParticleSystem.MainModule main = ps.main; float newDuration = (maxScale / scaleRate) - main.startLifetime.constantMax; main.duration = newDuration; vfx.Play(); }