コード例 #1
0
    //セルを燃やす
    private bool ExplodeCell(Vector3Int pos)
    {
        //ハードブロックがある場合は止める
        if (fieldController.tilemapHardBlock.GetTile(pos) != null)
        {
            return(false);
        }

        //ソフトブロック
        if (fieldController.tilemapSoftBlock.GetTile(pos) != null)
        {
            fieldController.ExplodeSoftBlock(pos);
            return(false);
        }

        //爆風を出現
        Instantiate(explosion, fieldController.grid.CellToLocalInterpolated(pos + new Vector3(0.5f, 0.5f)), Quaternion.identity, transform.parent);

        //燃え広がる
        return(true);
    }