projekt-bombs/Assets/Scripts/src/Wall/DestructibleWall.cs

43 lines
957 B
C#
Raw Normal View History

2019-06-10 14:28:33 +00:00
using UnityEngine;
using src.Base;
namespace src.Wall
{
2019-06-10 14:28:33 +00:00
public class DestructibleWall : GameplayComponent, IExplosable
{
private bool _spawnExit;
private bool _spawnUpgrade;
public void SpawnsExit()
{
_spawnExit = true;
}
public void SpawnsUpgrade()
{
_spawnUpgrade = true;
}
public float XCoordinate => transform.position.x;
public float YCoordinate => transform.position.y;
public void OnDestroy()
{
if (_spawnExit)
{
// TODO Spawn an exit
}
else if (_spawnUpgrade)
{
// TODO Spawn an upgrade, use composition to UpgradeManager
// to get random / desired upgrade
}
}
2019-06-10 14:28:33 +00:00
public void onExplosion()
{
Debug.Log("Destructible wall hitted by explosion");
}
}
}