public void ApplyPatch(TextPatch patch) { Enabled = Enabled.ApplyPatch(patch.Enabled); Contents = Contents.ApplyPatch(patch.Contents); PixelsPerLine = PixelsPerLine.ApplyPatch(patch.PixelsPerLine); Height = Height.ApplyPatch(patch.Height); Anchor = Anchor.ApplyPatch(patch.Anchor); Justify = Justify.ApplyPatch(patch.Justify); Font = Font.ApplyPatch(patch.Font); Color = Color.ApplyPatch(patch.Color); }
/// <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)); } }