mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 20:13:02 +00:00
refactor
This commit is contained in:
parent
88cd91d0bd
commit
9c0bcd747b
1 changed files with 5 additions and 12 deletions
|
@ -1,12 +1,8 @@
|
||||||
using SanAndreasUnity.Behaviours.Vehicles;
|
using SanAndreasUnity.Importing.Conversion;
|
||||||
using SanAndreasUnity.Importing.Conversion;
|
|
||||||
using SanAndreasUnity.Utilities;
|
using SanAndreasUnity.Utilities;
|
||||||
using System;
|
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.IO;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using Object = UnityEngine.Object;
|
|
||||||
|
|
||||||
namespace SanAndreasUnity.Behaviours
|
namespace SanAndreasUnity.Behaviours
|
||||||
{
|
{
|
||||||
|
@ -78,9 +74,6 @@ namespace SanAndreasUnity.Behaviours
|
||||||
public Texture2D BlackPixel { get; private set; }
|
public Texture2D BlackPixel { get; private set; }
|
||||||
public Texture2D SeaPixel { get; private set; }
|
public Texture2D SeaPixel { get; private set; }
|
||||||
|
|
||||||
private Ped m_ped => Ped.Instance;
|
|
||||||
private PlayerController m_playerController => PlayerController.Instance;
|
|
||||||
|
|
||||||
private TextureDictionary huds;
|
private TextureDictionary huds;
|
||||||
|
|
||||||
private Sprite mapSprite;
|
private Sprite mapSprite;
|
||||||
|
@ -202,7 +195,7 @@ namespace SanAndreasUnity.Behaviours
|
||||||
|
|
||||||
// update focus position
|
// update focus position
|
||||||
|
|
||||||
var ped = m_ped;
|
var ped = Ped.Instance;
|
||||||
if (ped != null)
|
if (ped != null)
|
||||||
this.FocusPos = ped.transform.position;
|
this.FocusPos = ped.transform.position;
|
||||||
else if (Camera.main != null)
|
else if (Camera.main != null)
|
||||||
|
@ -210,7 +203,7 @@ namespace SanAndreasUnity.Behaviours
|
||||||
|
|
||||||
// update zoom based on ped's velocity
|
// update zoom based on ped's velocity
|
||||||
|
|
||||||
var playerController = m_playerController;
|
var playerController = PlayerController.Instance;
|
||||||
if (playerController != null)
|
if (playerController != null)
|
||||||
zoom = Mathf.Lerp(.9f, 1.3f, 1 - Mathf.Clamp(playerController.CurVelocity, 0, maxVelocityForZooming) / maxVelocityForZooming) * curZoomPercentage;
|
zoom = Mathf.Lerp(.9f, 1.3f, 1 - Mathf.Clamp(playerController.CurVelocity, 0, maxVelocityForZooming) / maxVelocityForZooming) * curZoomPercentage;
|
||||||
|
|
||||||
|
@ -239,8 +232,8 @@ namespace SanAndreasUnity.Behaviours
|
||||||
if (northPivot != null)
|
if (northPivot != null)
|
||||||
northPivot.localRotation = Quaternion.Euler(0, 0, relAngle);
|
northPivot.localRotation = Quaternion.Euler(0, 0, relAngle);
|
||||||
|
|
||||||
if (playerImage != null && m_ped != null)
|
if (playerImage != null && ped != null)
|
||||||
playerImage.rectTransform.localRotation = Quaternion.Euler(0, 0, relAngle - (m_ped.transform.eulerAngles.y + 180));
|
playerImage.rectTransform.localRotation = Quaternion.Euler(0, 0, relAngle - (ped.transform.eulerAngles.y + 180));
|
||||||
|
|
||||||
// update zone name label
|
// update zone name label
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue