Ejemplo n.º 1
0
    public virtual void OnStructureDestroyed()
    {
        currentStructureCount--;
        if (maxStructureCount > 0)
        {
            canPlaceMore = true;
        }

        if (currentStructureCount == 0)
        {
            defenderSpawner.RemoveCell(new Vector2(Mathf.RoundToInt(transform.position.x), Mathf.RoundToInt(transform.position.y)));
            defenderSpawner.structures.Remove(this);
            Destroy(gameObject, destroyAnimationTime);
        }
    }