/// <summary> /// Reflects the given directional laser in a reflected direction at the hit position /// </summary> /// <param name="dirLaser"> Directional laser to be reflected </param> /// <param name="hitPosition"> Position where the given directional laser hits </param> public void ReflectLaser(DirectionalLaser dirLaser, Vector3 hitPosition) { var mirroredDirection = LaserUtil.GetMirroredDirection(FaceDirection, dirLaser.Direction); if (mirroredDirection != null) { LaserUtil.SendLaser(this, dirLaser.Laser, mirroredDirection.Value, hitPosition); } }
private void Update() { if (laserObject.IsPowered) { for (int i = 0; i < outputLasers.Length; i++) { if (!outputLasers[i].IsNullLaser) { LaserUtil.SendLaser(this, outputLasers[i], (Direction)i); } } } }
/// <summary> /// Filters the given laser and sends the filtered laser out in the same direction from the hit position /// </summary> /// <param name="dirLaser"> Directional laser to be filtered </param> /// <param name="hitPosition"> Position where the given directional laser hits </param> public void FilterLaser(DirectionalLaser dirLaser, Vector3 hitPosition) { LaserUtil.SendLaser(this, Laser.Filter(dirLaser.Laser, filterColor), dirLaser.Direction, hitPosition); }