Ejemplo n.º 1
0
 /// <inheritdoc />
 public void ApplyPatch(LightPatch patch)
 {
     _light.Visible     = _light.Visible.GetPatchApplied(Enabled.ApplyPatch(patch.Enabled));
     _light.LightColor  = _light.LightColor.GetPatchApplied(Color.ApplyPatch(patch.Color));
     _light.LightEnergy = _light.LightEnergy.GetPatchApplied(Intensity.ApplyPatch(patch.Intensity));
     if (_light is SpotLight spotLight)
     {
         if (patch.SpotAngle.HasValue)
         {
             spotLight.SpotAngle = Mathf.Rad2Deg(patch.SpotAngle.Value);
         }
         spotLight.SpotRange = spotLight.SpotRange.GetPatchApplied(Range.ApplyPatch(patch.Range));
     }
     else if (_light is OmniLight omniLight)
     {
         omniLight.OmniRange = omniLight.OmniRange.GetPatchApplied(Range.ApplyPatch(patch.Range));
     }
 }