| | 1 | | using DCL.Interface; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | namespace DCL.SettingsControls |
| | 5 | | { |
| | 6 | | [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Scenes Load Radius", fileName = "ScenesLoadRadiusControlC |
| | 7 | | public class ScenesLoadRadiusControlController : SliderSettingsControlController |
| | 8 | | { |
| | 9 | | public override void Initialize() |
| | 10 | | { |
| 1 | 11 | | base.Initialize(); |
| | 12 | |
|
| 1 | 13 | | ApplyAndReportScenesLoadRadius(currentGeneralSettings.scenesLoadRadius, true); |
| 1 | 14 | | } |
| | 15 | |
|
| 1 | 16 | | public override object GetStoredValue() { return currentGeneralSettings.scenesLoadRadius; } |
| | 17 | |
|
| 2 | 18 | | public override void UpdateSetting(object newValue) { ApplyAndReportScenesLoadRadius((float)newValue); } |
| | 19 | |
|
| | 20 | | private void ApplyAndReportScenesLoadRadius(float newRadius, bool forceApply = false) |
| | 21 | | { |
| 2 | 22 | | if (!forceApply && newRadius == currentGeneralSettings.scenesLoadRadius) |
| 1 | 23 | | return; |
| | 24 | |
|
| 1 | 25 | | currentGeneralSettings.scenesLoadRadius = newRadius; |
| | 26 | |
|
| | 27 | | // trigger LOS update and re-load of surrounding parcels in Kernel |
| 1 | 28 | | WebInterface.SetScenesLoadRadius(newRadius); |
| 1 | 29 | | } |
| | 30 | | } |
| | 31 | | } |