Exemple #1
0
    public void ApplyDamage(float amount, DamageType type, Vector2 damageDirection)
    {
        m_health -= amount;

        if (m_health <= 0.0f && !m_destroyed)
        {
            // Tell the walls system that this chunk is destroyed so it can prompt a mesh rebuild
            m_parentWalls.ChunkDestroyed(this);

            // Update the chunk's collision type, but that's all really...
            m_owner.RemoveType(GetContentsType());
            m_destroyed = true;
            m_owner.AddType(GetContentsType());

            Level.Instance.GetGrid().UpdateCellBlocked(m_owner.x, m_owner.y, false);
        }
    }