mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-26 22:10:17 +00:00
don't update stuff when minimap is not visible
This commit is contained in:
parent
0668cf62f1
commit
9d4ca5aae6
1 changed files with 8 additions and 2 deletions
|
@ -34,6 +34,8 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
public Text zoneNameLabel;
|
||||
|
||||
private Canvas _canvas;
|
||||
|
||||
public float zoom = 1.3f;
|
||||
private const float scaleConst = 1f;
|
||||
|
||||
|
@ -49,6 +51,8 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
public Vector3 FocusPos { get; set; } = Vector3.zero;
|
||||
|
||||
public bool IsMinimapVisible => _canvas.enabled && this.gameObject.activeInHierarchy;
|
||||
|
||||
public bool debugActive = true;
|
||||
|
||||
#region "Properties"
|
||||
|
@ -204,6 +208,8 @@ namespace SanAndreasUnity.Behaviours
|
|||
{
|
||||
Instance = this;
|
||||
|
||||
_canvas = this.GetComponentInParent<Canvas>();
|
||||
|
||||
if (!isReady)
|
||||
return;
|
||||
|
||||
|
@ -316,8 +322,8 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (!isReady) return;
|
||||
if (m_playerController != null && !GameManager.CanPlayerReadInput() && debugActive) return;
|
||||
if (!this.IsMinimapVisible)
|
||||
return;
|
||||
|
||||
|
||||
//Vector3 defPos = (new Vector3(pPos.x, pPos.z, 0) * (uiSize / -1000f)) / scaleConst; // Why?
|
||||
|
|
Loading…
Reference in a new issue