mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 06:34:16 +00:00
Load "Max draw distance" setting on start
This commit is contained in:
parent
e8e6b6cd91
commit
94de5c4a48
2 changed files with 19 additions and 4 deletions
|
@ -7,20 +7,33 @@ namespace SanAndreasUnity.Settings {
|
|||
|
||||
public class WorldSettings : MonoBehaviour {
|
||||
|
||||
static float s_maxDrawDistance = 500f;
|
||||
|
||||
OptionsWindow.FloatInput m_maxDrawDistanceInput = new OptionsWindow.FloatInput() {
|
||||
description = "Max draw distance",
|
||||
minValue = 50,
|
||||
maxValue = 1000,
|
||||
isAvailable = () => Cell.Instance != null,
|
||||
getValue = () => Cell.Instance.maxDrawDistance,
|
||||
setValue = (value) => { Cell.Instance.maxDrawDistance = value; },
|
||||
persistType = OptionsWindow.InputPersistType.AfterLoaderFinishes
|
||||
getValue = () => Cell.Instance != null ? Cell.Instance.maxDrawDistance : s_maxDrawDistance,
|
||||
setValue = (value) => { s_maxDrawDistance = value; if (Cell.Instance != null) Cell.Instance.maxDrawDistance = value; },
|
||||
persistType = OptionsWindow.InputPersistType.OnStart
|
||||
};
|
||||
|
||||
|
||||
void Awake ()
|
||||
{
|
||||
OptionsWindow.RegisterInputs ("WORLD", m_maxDrawDistanceInput);
|
||||
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += (s1, s2) => OnActiveSceneChanged();
|
||||
}
|
||||
|
||||
void OnActiveSceneChanged()
|
||||
{
|
||||
// apply settings
|
||||
|
||||
// we need to find Cell with FindObjectOfType(), because it's Awake() method may have not been called yet
|
||||
Cell cell = Object.FindObjectOfType<Cell>();
|
||||
if (cell != null)
|
||||
cell.maxDrawDistance = s_maxDrawDistance;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
- add current vehicle info to "misc" stats - it will display: name, velocity, num wheels, num doors, num peds inside, input, mass, drag, rigid body state, sync interval,
|
||||
|
||||
- display players on minimap
|
||||
|
||||
- **vehicle is bumping on clients** - disable (or destroy) wheel colliders, and sync them - this should not be done on local player, see below
|
||||
|
||||
- when exit vehicle anim is finished on client, it is repeated - change wrap mode
|
||||
|
|
Loading…
Reference in a new issue