public void Clear() { gameObject.SetActive(false); foreach (GameObject renderedBlock in renderedBlocks) { BlockBehaviour bh = renderedBlock.GetComponent <BlockBehaviour>(); bh.Clear(); } }
public virtual void DamageBlock(BlockBehaviour bh, Damage damage) { bh.block.Health -= damage.value; if (bh.block.Health <= 0) { bh.block.SetEmpty(); bh.Clear(); if (dropList != null) { foreach (Item item in dropList) { GameObject dropped = ItemObjectFactory.Instance.CreateDroppedItem(item, bh.Position + new Vector3(0.5f, 0.5f, 0)); } } } }