display vehicles on minimap

This commit is contained in:
in0finite 2019-07-13 20:35:24 +02:00
parent 853a264750
commit 09daa45721
5 changed files with 57 additions and 11 deletions

View file

@ -109,6 +109,8 @@ namespace SanAndreasUnity.Behaviours
public Texture2D WaypointTexture { get { return this.waypointTexture; } }
public Texture2D VehicleTexture => this.vehicleTexture;
public Texture2D MapTexture { get { return this.mapTexture; } }
public Texture2D BlackPixel { get { return this.blackPixel; } }
@ -197,6 +199,7 @@ namespace SanAndreasUnity.Behaviours
northBlip = huds.GetDiffuse("radar_north").Texture;
playerBlip = huds.GetDiffuse("radar_centre").Texture;
waypointTexture = huds.GetDiffuse("radar_waypoint").Texture;
vehicleTexture = huds.GetDiffuse("radar_impound").Texture;
Debug.Log("Finished loading minimap textures!");
}
@ -212,7 +215,7 @@ namespace SanAndreasUnity.Behaviours
private TextureDictionary huds;
private Texture2D northBlip, playerBlip, waypointTexture, mapTexture;
private Texture2D northBlip, playerBlip, waypointTexture, vehicleTexture, mapTexture;
private Sprite mapSprite, circleMask;
private Transform northPivot;

View file

@ -0,0 +1,42 @@
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 );
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b9d35d1455c83dba68341b83b1ead322
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -6,16 +6,8 @@
- add ability for client to request:
- roll state: when doing more rolls one after another, client doesn't play anim anymore ; sometimes rolling continues even if WASD keys are not pressed ;
- shooting is inaccurate - clients should send fire event with fire pos and fire dir
- send fireDir with other input to server
- remove spamming logs:
- sometimes, current vehicle is null on client
- test situation when player connects, and there are peds sitting in vehicles
***

View file

@ -34,8 +34,6 @@
- Add option to change fixed delta time ?
- Crouching: adjust camera aim offset ? ; **adjust height offset of ped - only state that needs to do this is CrouchState** ;
- Optimize Console.Update() - don't do trim excess for every log message
- don't fade high LOD meshes