mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 20:13:02 +00:00
extract input reading into a method
This commit is contained in:
parent
9d4ca5aae6
commit
dc37e76e6b
1 changed files with 16 additions and 7 deletions
|
@ -280,22 +280,31 @@ namespace SanAndreasUnity.Behaviours
|
|||
Debug.Log("Minimap started!");
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.N) && GameManager.CanPlayerReadInput())
|
||||
if (GameManager.CanPlayerReadInput())
|
||||
{
|
||||
this.ReadInput();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ReadInput()
|
||||
{
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.N))
|
||||
++zoomSelector;
|
||||
else if (Input.GetKeyDown(KeyCode.B) && GameManager.CanPlayerReadInput())
|
||||
else if (Input.GetKeyDown(KeyCode.B))
|
||||
--zoomSelector;
|
||||
|
||||
if ((Input.GetKeyDown(KeyCode.N) || Input.GetKeyDown(KeyCode.B)) && GameManager.CanPlayerReadInput())
|
||||
if (Input.GetKeyDown(KeyCode.N) || Input.GetKeyDown(KeyCode.B))
|
||||
{
|
||||
if (zoomCoroutine != null) StopCoroutine(zoomCoroutine);
|
||||
if (zoomCoroutine != null)
|
||||
StopCoroutine(zoomCoroutine);
|
||||
zoomCoroutine = StartCoroutine(ChangeZoom(Input.GetKeyDown(KeyCode.N)));
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.F8) && GameManager.CanPlayerReadInput())
|
||||
if (Input.GetKeyDown(KeyCode.F8))
|
||||
toggleInfo = !toggleInfo;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static Vector2 WorldPosToMapPos(Vector3 worldPos)
|
||||
|
|
Loading…
Reference in a new issue