- added art for house and UI - put population in ResourceManager - create house prefab - added code for adding and removing pop depending on entity - refactor harvesters so they inherit from ally - modify placeholders and buttons so that only units cost population - add events for population and resources changing - add population relative configs to global config - add start resources values to Levels - add debug feature for generating resources for free
49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine.Tilemaps;
|
|
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
namespace GatherAndDefend.LevelEditor
|
|
{
|
|
public class Level : ScriptableObject, IEnumerable<TilemapData>
|
|
{
|
|
private Rect _bounds;
|
|
public Rect Bounds => _bounds;
|
|
[SerializeField]
|
|
private List<TilemapData> _data = new List<TilemapData>();
|
|
[SerializeField]
|
|
private WaveConfig _waveConfig;
|
|
public void SaveFromTilemap(Tilemap tilemap)
|
|
{
|
|
var data = new TilemapData();
|
|
data.SaveFromTilemap(tilemap);
|
|
_data.Add(data);
|
|
}
|
|
|
|
[SerializeField]
|
|
private int _startPopulation = 5;
|
|
[SerializeField]
|
|
private int _startFood = 50;
|
|
[SerializeField]
|
|
private int _startWood = 0;
|
|
[SerializeField]
|
|
private int _startRock = 0;
|
|
public int StartPopulation => _startPopulation;
|
|
public int StartFood => _startFood;
|
|
public int StartWood => _startWood;
|
|
public int StartRock => _startRock;
|
|
|
|
|
|
public WaveConfig WaveConfig { get { return _waveConfig; } }
|
|
|
|
public IEnumerator<TilemapData> GetEnumerator()
|
|
{
|
|
return _data.GetEnumerator();
|
|
}
|
|
|
|
IEnumerator IEnumerable.GetEnumerator()
|
|
{
|
|
return _data.GetEnumerator();
|
|
}
|
|
}
|
|
} |