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