private void TryBombDrop() { if (bombDropSystem.CanDropBomb(Time.time)) { RaycastHit2D hit = Physics2D.Raycast(transform.position, Vector2.down, 0.1f, raycastFilterLayer); if (hit.collider != null && hit.collider.CompareTag("Ground")) { CmdDropBomb(hit.collider.transform.position); bombDropSystem.BombDroped(Time.time); } } }
private void TryBombDrop() { if (bombDropSystem.CanDropBomb(Time.time)) { RaycastHit2D hit = Physics2D.Raycast(transform.position, Vector2.down, 0.1f, raycastFilterLayer); if (hit.collider != null && hit.collider.CompareTag("Ground")) { GroundTile groundTile = hit.collider.gameObject.GetComponent <GroundTile>(); DropBomb(hit.collider.transform.position, groundTile); bombDropSystem.BombDroped(Time.time); } } }