fix: Update data view distance config.

This commit is contained in:
Tungdv
2026-05-15 11:36:23 +07:00
parent 884368e612
commit d8adcc8258
3 changed files with 55 additions and 44 deletions
@@ -14,58 +14,58 @@ MonoBehaviour:
m_EditorClassIdentifier:
viewDistanceCfg:
- title: Config 1
show: 100
hide: 300
fShow: 200
fHide: 400
- title: Config 2
show: 200
hide: 400
fShow: 400
fHide: 600
- title: Config 3
show: 350
hide: 550
fShow: 600
fHide: 800
- title: Config 4
show: 500
hide: 700
fShow: 800
fHide: 1000
- title: Config 5
show: 650
hide: 850
fShow: 1000
fHide: 1200
- title: Config 6
show: 800
hide: 1000
fShow: 1200
fHide: 1400
viewDistanceNPCCfg:
- title: Config 1
show: 10
hide: 25
fShow: 25
fHide: 40
- title: Config 2
show: 25
hide: 40
fShow: 40
fHide: 55
- title: Config 3
show: 40
hide: 55
fShow: 55
fHide: 70
- title: Config 4
show: 55
hide: 70
fShow: 70
fHide: 85
- title: Config 5
show: 70
hide: 85
fShow: 85
fHide: 100
- title: Config 6
show: 85
hide: 100
fShow: 100
fHide: 115
viewDistanceEPCfg:
- title: Config 1
show: 10
hide: 25
fShow: 25
fHide: 40
- title: Config 2
show: 25
hide: 40
fShow: 40
fHide: 55
- title: Config 3
show: 40
hide: 55
fShow: 55
fHide: 70
- title: Config 4
show: 55
hide: 70
fShow: 70
fHide: 85
- title: Config 5
show: 70
hide: 85
fShow: 85
fHide: 100
- title: Config 6
show: 85
hide: 100
fShow: 100
fHide: 115
@@ -49,6 +49,9 @@ namespace BrewMonster.Network
private readonly static string keySettingActiveShadow = "_keySettingActiveShadow";
private readonly static string keySettingActiveFullResolution = "_keySettingActiveFullResolution";
private readonly static string keySettingActiveFog = "_keySettingActiveFog";
private static ViewDistance m_viewDistance;
private static ViewDistance m_viewDistanceNPC;
private static ViewDistance m_viewDistanceEP;
#endregion
#region Properties
@@ -149,6 +152,7 @@ namespace BrewMonster.Network
LoadPetAutoSkill();
GlobalDataManager.globaldata_load();
InitSetting();
return true;
}
public static CECConfigs GetConfigs() { return m_pConfigs; }
@@ -637,22 +641,29 @@ namespace BrewMonster.Network
}
}
public static void InitSetting()
{
int index = PlayerPrefs.GetInt(keySettingViewDistance, defaultValue: 5);
m_viewDistance = GameRunConfigSO.GetViewDistanceCfg[index];
index = PlayerPrefs.GetInt(keySettingViewDistanceNPC, defaultValue: 5);
m_viewDistanceNPC = GameRunConfigSO.GetViewDistanceNPCCfg[index];
index = PlayerPrefs.GetInt(keySettingViewDistanceEP, defaultValue: 5);
m_viewDistanceEP = GameRunConfigSO.GetViewDistanceEPCfg[index];
}
public static ViewDistance GetSettingViewDistance()
{
int index = PlayerPrefs.GetInt(keySettingViewDistance, defaultValue: 1);
return gameRunConfigSO.GetViewDistanceCfg[index];
return m_viewDistance;
}
public static ViewDistance GetSettingViewDistanceNPC()
{
int index = PlayerPrefs.GetInt(keySettingViewDistanceNPC, defaultValue: 1);
return gameRunConfigSO.GetViewDistanceNPCCfg[index];
return m_viewDistanceNPC;
}
public static ViewDistance GetSettingViewDistanceEP()
{
int index = PlayerPrefs.GetInt(keySettingViewDistanceEP, defaultValue: 1);
return gameRunConfigSO.GetViewDistanceEPCfg[index];
return m_viewDistanceEP;
}
public static bool GetSettingActiveShadow()
@@ -17,8 +17,8 @@ namespace BrewMonster
public class TerrainHolder : MonoBehaviour
{
[SerializeField] private AddressableObject[] _addressableObjects;
[SerializeField] private float _loadImmediateDistance => EC_Game.GetSettingViewDistance().fShow; // 150f
[SerializeField] private float _unloadDistance => EC_Game.GetSettingViewDistance().fHide; // 300f
[SerializeField] private float _loadImmediateDistance => EC_Game.GetSettingViewDistance().fShow; //150f;
[SerializeField] private float _unloadDistance => EC_Game.GetSettingViewDistance().fHide; //300f;
[SerializeField] private float _minHostMoveToUpdate = 5f;
private List<AddressableObject> _candidatesForLoading = new List<AddressableObject>();