mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-27 06:20:17 +00:00
42 lines
961 B
C#
42 lines
961 B
C#
using UnityEngine;
|
|
using SanAndreasUnity.UI;
|
|
using SanAndreasUnity.Behaviours.Vehicles;
|
|
using SanAndreasUnity.Utilities;
|
|
|
|
namespace SanAndreasUnity.Behaviours
|
|
{
|
|
|
|
public class Vehicle2Minimap : MonoBehaviour
|
|
{
|
|
|
|
Vehicle m_vehicle;
|
|
|
|
|
|
void Start()
|
|
{
|
|
// use Start(), because vehicle script is dynamically added to game object
|
|
m_vehicle = this.GetComponentOrThrow<Vehicle>();
|
|
}
|
|
|
|
void OnEnable()
|
|
{
|
|
UI.MapWindow.Instance.onDrawMapItems += OnMinimapGUI;
|
|
}
|
|
|
|
void OnDisable()
|
|
{
|
|
UI.MapWindow.Instance.onDrawMapItems -= OnMinimapGUI;
|
|
}
|
|
|
|
void OnMinimapGUI()
|
|
{
|
|
if (null == m_vehicle)
|
|
return;
|
|
|
|
//MapWindow.Instance.DrawItemOnMap( MiniMap.Instance.VehicleTexture, m_vehicle.transform.position, 12 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|