Changed available buildings to dictionary
This commit is contained in:
parent
cea045ae2c
commit
9b72751e15
|
@ -1,7 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AsteroidGame.Entities.Structures.Scripts;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
|
@ -23,7 +21,7 @@ namespace AsteroidGame.Handlers
|
|||
|
||||
#region Private
|
||||
|
||||
private List<StructureBase> _availableStructures = new();
|
||||
private Dictionary<int, StructureBase> _availableStructures = new();
|
||||
[SerializeField] private Color colorCurrent;
|
||||
private Camera _camera;
|
||||
[SerializeField] private List<StructureBase> activeStructures;
|
||||
|
@ -34,14 +32,16 @@ namespace AsteroidGame.Handlers
|
|||
private MeshRenderer[] _ghostStructureMeshRenderers;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
base.OnEnable();
|
||||
for (int i = 0; i < availableStructuresObject.structureList.Count; i++)
|
||||
{
|
||||
_availableStructures.Add(i, availableStructuresObject.structureList[i]);
|
||||
}
|
||||
_camera = Camera.main;
|
||||
_buildPlane = new Plane(Vector3.up, Vector3.zero);
|
||||
_availableStructures = availableStructuresObject.structureList;
|
||||
activeStructures.Clear();
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ namespace AsteroidGame.Handlers
|
|||
return Vector3.zero;
|
||||
}
|
||||
|
||||
public List<StructureBase> GetAvailableStructures()
|
||||
public Dictionary<int, StructureBase> GetAvailableStructures()
|
||||
{
|
||||
return _availableStructures;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue