mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-16 21:08:28 +00:00
move input reading to LateUpdate() ; remove Update() because it's no longer needed ;
This commit is contained in:
parent
eb7123be57
commit
03c451d0a9
1 changed files with 9 additions and 15 deletions
|
@ -199,19 +199,6 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!this.IsMinimapVisible)
|
||||
return;
|
||||
|
||||
|
||||
if (GameManager.CanPlayerReadInput() && this.IsMinimapVisible)
|
||||
{
|
||||
this.ReadInput();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ReadInput()
|
||||
{
|
||||
|
||||
|
@ -288,13 +275,20 @@ namespace SanAndreasUnity.Behaviours
|
|||
if (playerController != null)
|
||||
realZoom = Mathf.Lerp(.9f * scaleConst, 1.3f * scaleConst, 1 - Mathf.Clamp(playerController.CurVelocity, 0, maxVelocity) / maxVelocity) * curZoomPercentage;
|
||||
|
||||
// update position
|
||||
// read input
|
||||
|
||||
if (GameManager.CanPlayerReadInput())
|
||||
{
|
||||
this.ReadInput();
|
||||
}
|
||||
|
||||
// update position of UI
|
||||
|
||||
int worldSize = mapSize * 4;
|
||||
Vector3 mapPos = - new Vector3(this.FocusPos.x, this.FocusPos.z, 0f) * mapSize / (float)worldSize;
|
||||
mapImage.rectTransform.localPosition = mapPos;
|
||||
|
||||
// update rotation
|
||||
// update rotation of UI
|
||||
|
||||
float relAngle = Camera.main != null ? Camera.main.transform.eulerAngles.y : 0f;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue