public void AddBeam( Vector3 position, Vector3 direction, LaserSource source) { LaserBeam beam = new LaserBeam(); beam.color = source.laserColor; beam.segments.Add(new LaserSegment(position, direction)); beam.source = source; beam.bounced = false; beams.Add(beam); }
public void AddBeam(Vector3 position, Vector3 direction, LaserSource source) { LaserBeam beam = new LaserBeam(); beam.color = source.laserColor; beam.segments.Add(new LaserSegment(position, direction)); beam.source = source; beam.bounced = false; beams.Add(beam); }
public ShieldProjectorCannon(GDGameScreen scrn, ShieldProjectorBlueprint bp, Fraction[] fractions) : base(scrn, fractions, bp.Player, bp.X, bp.Y, bp.Diameter, bp.CannonID, bp.Rotation, bp.PrecalculatedPaths) { Blueprint = bp; _screen = scrn; _muted = scrn.IsPreview; LaserSource = scrn.LaserNetwork.AddSource(this); _soundeffect = MainGame.Inst.GDSound.GetEffectLaser(this); _soundeffect.IsLooped = true; }
public LaserCannon(GDGameScreen scrn, LaserCannonBlueprint bp, Fraction[] fractions) : base(scrn, fractions, bp.Player, bp.X, bp.Y, bp.Diameter, bp.CannonID, bp.Rotation, bp.PrecalculatedPaths) { Blueprint = bp; _screen = scrn; _muted = scrn.IsPreview; LaserSource = scrn.LaserNetwork.AddSource(this); coreImage = FloatMath.GetRangedIntRandom(0, Textures.CANNONCORE_COUNT); coreRotation = FloatMath.GetRangedRandom(FloatMath.RAD_POS_000, FloatMath.RAD_POS_360); _soundeffect = MainGame.Inst.GDSound.GetEffectLaser(this); _soundeffect.IsLooped = true; }
public override void OnCollisionWithLaser(LaserSource laserSource) { base.OnCollisionWithLaser(laserSource); if (_platform.CurrentOrLastPlatform) { _movement.ForceMove(_platform.CurrentOrLastPlatform.RespawnPoint.position, _movement.TargetRotation); _platform.CurrentOrLastPlatform.RePlacePlatform(); if (takeDamageAudio) { takeDamageAudio.Play(); } } else { _movement.ForceMove(default, _movement.TargetRotation);
void Start() { lineRenderer = GetComponent <LineRenderer>(); laserSource = source.transform.GetComponent <LaserSource>(); layermask = (1 << 10) + (1 << 11); }