mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 20:13:02 +00:00
map window draws enexes
This commit is contained in:
parent
1bdc7226e5
commit
1efa38ff84
3 changed files with 21 additions and 5 deletions
|
@ -103,17 +103,13 @@ namespace SanAndreasUnity.Behaviours
|
|||
}
|
||||
|
||||
public Texture2D NorthBlip { get { return this.northBlip; } }
|
||||
|
||||
public Texture2D PlayerBlip { get { return this.playerBlip; } }
|
||||
|
||||
public Texture2D WaypointTexture { get { return this.waypointTexture; } }
|
||||
|
||||
public Texture2D VehicleTexture => this.vehicleTexture;
|
||||
|
||||
public Texture2D GreenHouseTexture { get; private set; }
|
||||
public Texture2D MapTexture { get { return this.mapTexture; } }
|
||||
|
||||
public Texture2D BlackPixel { get { return this.blackPixel; } }
|
||||
|
||||
public Texture2D SeaPixel { get { return this.seaPixel; } }
|
||||
|
||||
#endregion "Properties"
|
||||
|
@ -178,6 +174,7 @@ namespace SanAndreasUnity.Behaviours
|
|||
playerBlip = huds.GetDiffuse("radar_centre").Texture;
|
||||
waypointTexture = huds.GetDiffuse("radar_waypoint").Texture;
|
||||
vehicleTexture = huds.GetDiffuse("radar_impound").Texture;
|
||||
GreenHouseTexture = huds.GetDiffuse("radar_propertyG").Texture;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
using UnityEngine;
|
||||
using SanAndreasUnity.Importing.Items.Placements;
|
||||
using SanAndreasUnity.Utilities;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SanAndreasUnity.Behaviours.World
|
||||
{
|
||||
|
||||
public class EntranceExitMapObject : MapObject
|
||||
{
|
||||
static List<EntranceExitMapObject> s_allObjects = new List<EntranceExitMapObject>();
|
||||
public static IEnumerable<EntranceExitMapObject> AllObjects => s_allObjects;
|
||||
|
||||
Coroutine m_animateArrowCoroutine;
|
||||
|
||||
public float minArrowPos = -1f;
|
||||
public float maxArrowPos = 1f;
|
||||
public Transform arrowTransform;
|
||||
|
@ -51,11 +56,14 @@ namespace SanAndreasUnity.Behaviours.World
|
|||
|
||||
void OnEnable()
|
||||
{
|
||||
s_allObjects.Add(this);
|
||||
m_animateArrowCoroutine = this.StartCoroutine(this.AnimateArrow());
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
s_allObjects.Remove(this);
|
||||
|
||||
if (m_animateArrowCoroutine != null)
|
||||
this.StopCoroutine(m_animateArrowCoroutine);
|
||||
m_animateArrowCoroutine = null;
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace SanAndreasUnity.UI {
|
|||
private float m_playerPointerSize = 10;
|
||||
public float PlayerPointerSize { get => m_playerPointerSize; set { m_playerPointerSize = value; } }
|
||||
private bool m_drawZones = false;
|
||||
private bool m_drawEnexes = true;
|
||||
|
||||
private bool m_isWaypointPlaced = false;
|
||||
private Vector2 m_waypointMapPos = Vector2.zero;
|
||||
|
@ -541,6 +542,7 @@ namespace SanAndreasUnity.UI {
|
|||
GUILayout.Label ("Player size: " + (int) m_playerPointerSize, GUILayout.ExpandWidth(false));
|
||||
m_playerPointerSize = GUILayout.HorizontalSlider (m_playerPointerSize, 1, 50, GUILayout.MinWidth(40));
|
||||
m_drawZones = GUILayout.Toggle (m_drawZones, "Draw zones");
|
||||
m_drawEnexes = GUILayout.Toggle(m_drawEnexes, "Draw enexes");
|
||||
|
||||
GUILayout.EndHorizontal ();
|
||||
|
||||
|
@ -594,6 +596,15 @@ namespace SanAndreasUnity.UI {
|
|||
// draw registered items
|
||||
onDrawMapItems();
|
||||
|
||||
// draw enexes
|
||||
if (m_drawEnexes)
|
||||
{
|
||||
foreach (var enex in Behaviours.World.EntranceExitMapObject.AllObjects)
|
||||
{
|
||||
this.DrawItemOnMap(MiniMap.Instance.GreenHouseTexture, enex.transform.position, 10);
|
||||
}
|
||||
}
|
||||
|
||||
// draw player pointer
|
||||
if (Ped.Instance != null)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue