2019-06-04 17:20:53 +00:00
|
|
|
using src.Base;
|
|
|
|
|
|
|
|
namespace src.Wall
|
|
|
|
{
|
|
|
|
public class DestructibleWall : GameplayComponent
|
|
|
|
{
|
|
|
|
private bool _spawnExit;
|
|
|
|
private bool _spawnUpgrade;
|
|
|
|
|
|
|
|
public void SpawnsExit()
|
|
|
|
{
|
|
|
|
_spawnExit = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void SpawnsUpgrade()
|
|
|
|
{
|
|
|
|
_spawnUpgrade = true;
|
|
|
|
}
|
2019-06-05 19:24:19 +00:00
|
|
|
|
|
|
|
public float XCoordinate => transform.position.x;
|
|
|
|
public float YCoordinate => transform.position.y;
|
|
|
|
|
2019-06-04 17:20:53 +00:00
|
|
|
public void OnDestroy()
|
|
|
|
{
|
|
|
|
if (_spawnExit)
|
|
|
|
{
|
|
|
|
// TODO Spawn an exit
|
2019-06-05 19:24:19 +00:00
|
|
|
}
|
|
|
|
else if (_spawnUpgrade)
|
2019-06-04 17:20:53 +00:00
|
|
|
{
|
|
|
|
// TODO Spawn an upgrade, use composition to UpgradeManager
|
|
|
|
// to get random / desired upgrade
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|