示例#1
0
    /// <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);
        }
    }
示例#2
0
 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);
             }
         }
     }
 }
示例#3
0
 /// <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);
 }