// Use this for initialization void Start() { InitObj(); laserParticle = LaserParticle.Instance; laserParticle.SetDuration(laserDuration); laserBeam.SetDuration(laserDuration); avatar = player.avatar.transform; spotLightAngle = flashLight.spotAngle; laserBeam.SetOffset(-Vector3.up * 0.3f); }
public override void Update(GameTime gameTime) { currentParticleTime += (float)gameTime.ElapsedGameTime.TotalSeconds; if (currentParticleTime >= particleTime) { LaserParticle laserParticle = new LaserParticle(position, true, color); LimitsEdgeGame.worldStateManager.particleManager.particles.Add(laserParticle); currentParticleTime = 0f; particleTime = LimitsEdgeGame.r.Next(0, 21) / 100f; } base.Update(gameTime); }