Mappp
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class MapController : MonoBehaviour
|
||||
@@ -6,15 +7,16 @@ public sealed class MapController : MonoBehaviour
|
||||
[Header("Main References")]
|
||||
[SerializeField] private MapCrosshairController crosshair = null;
|
||||
[SerializeField] private MapCoordinateSystem coordinateSystem = null;
|
||||
[SerializeField] private MapPlayer mapPlayer = null;
|
||||
|
||||
[Header("Target System")]
|
||||
[SerializeField] private MapTargetController targetController = null;
|
||||
[SerializeField] private MapTarget targetPrefab = null;
|
||||
[SerializeField] private Transform targetParent = null;
|
||||
[SerializeField] private bool createTargetsOnStart = true;
|
||||
|
||||
[Header("Radar System")]
|
||||
[SerializeField] private MapRadarController radarController = null;
|
||||
[FormerlySerializedAs("targetPrefab")]
|
||||
[SerializeField] private MapTarget radarMarkPrefab = null;
|
||||
|
||||
[Header("Crosshair Objects")]
|
||||
[SerializeField] private Transform relayX = null;
|
||||
@@ -30,19 +32,14 @@ public sealed class MapController : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (targetController != null)
|
||||
{
|
||||
targetController.Configure(
|
||||
coordinateSystem,
|
||||
targetPrefab,
|
||||
targetParent);
|
||||
if (mapPlayer != null)
|
||||
mapPlayer.Configure(coordinateSystem);
|
||||
|
||||
if (createTargetsOnStart)
|
||||
targetController.CreateAndPlaceTargets();
|
||||
}
|
||||
if (targetController != null)
|
||||
targetController.Configure(coordinateSystem, targetParent, mapPlayer);
|
||||
|
||||
if (radarController != null)
|
||||
radarController.Configure(coordinateSystem, targetController, targetPrefab);
|
||||
radarController.Configure(coordinateSystem, targetController, radarMarkPrefab);
|
||||
|
||||
if (crosshair == null)
|
||||
return;
|
||||
@@ -81,6 +78,11 @@ public sealed class MapController : MonoBehaviour
|
||||
targetController.CreateAndPlaceTargets();
|
||||
}
|
||||
|
||||
public bool StartNextWave()
|
||||
{
|
||||
return targetController != null && targetController.StartNextWave();
|
||||
}
|
||||
|
||||
public bool TryGetNearestTarget(out MapTarget target, out float distance)
|
||||
{
|
||||
if (crosshair != null)
|
||||
|
||||
Reference in New Issue
Block a user