SanAndreasUnity/Assets/Scripts/Behaviours/Vehicle2Minimap.cs
2020-05-31 19:09:46 +02:00

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 );
}
}
}