public void ConstructTileSprite(TileSprites tileSprite, Furniture furn)
    {
        //find neighbours
        int x = furn.tile.X;
        int y = furn.tile.Y;

        //A cares about N, NW, W
        tileSprite.SetA(GetTileSection(x, y, -1, 1, furn.objectType, "a"));
        //B cares about N, NE, E
        tileSprite.SetB(GetTileSection(x, y, 1, 1, furn.objectType, "b"));
        //C cares about S(0,-1), SW(-1,-1), W(-1,0)
        tileSprite.SetC(GetTileSection(x, y, -1, -1, furn.objectType, "c"));
        //D cares about S, SE, E
        tileSprite.SetD(GetTileSection(x, y, 1, -1, furn.objectType, "d"));
    }
    public void Initialise(TileTypes _type, Tile _tile, bool doSpawnAnim = true, bool refreshAllSprites = false)
    {
        gridTile = _tile;
        tileType = _type;

        childObject = gameObject.transform.GetChild(0).gameObject;
        ourSprite   = childObject.GetComponent <SpriteRenderer>();
        ourCollider = childObject.GetComponent <BoxCollider2D>();

        if (!doSpawnAnim)
        {
            GetComponent <Animator>().speed = 9999;
        }

        hasInitialised = true;
        spriteSet      = TileProperties.GetSpriteSet(tileType);

        //Try and occupy the tile we were given, this shouldn't really ever fail
        if (!gridTile.SetOccupied(this))
        {
            Debug.LogWarning("Failed to init tile! May be an issue with SetOccupied in grid.");
            Destroy(this.gameObject);
            return;
        }

        //Set tags for flocking AI
        if (!TileProperties.IsPathable(_type))
        {
            gameObject.layer = 30;                                    //"Obstacle"
        }
        else
        {
            gameObject.layer = 0;  //"Default"
        }
        //Enable collision for walls
        ourCollider.enabled = (TileProperties.GetVariant(_type) == TileVariant.WALL);

        //For neatness in the editor, parent to the grid
        this.gameObject.transform.parent = LevelManager.Instance.Grid.gameObject.transform;

        //Refresh sprites
        if (refreshAllSprites)
        {
            for (int i = 0; i < LevelManager.Instance.Grid.AllTiles.Count; i++)
            {
                if (LevelManager.Instance.Grid.AllTiles[i].IsOccupied && LevelManager.Instance.Grid.AllTiles[i].Occupier.Type == tileType)
                {
                    LevelManager.Instance.Grid.AllTiles[i].Occupier.RefreshSprite();
                }
            }
        }
        else
        {
            RefreshSprite();
        }

        if (LevelManager.Instance.IsInEditor)
        {
            //If in editor, spawn an invalid marker for UI use
            invalidMarker = Instantiate(LevelEditor.Instance.InvalidTileMarker, this.gameObject.transform.position, Quaternion.identity) as GameObject;
            invalidMarker.transform.parent = this.gameObject.transform;
            invalidMarker.SetActive(false);
        }
        else
        {
            //If out of editor, remove touchable from our child - it's not needed
            gameObject.transform.GetChild(0).gameObject.layer = gameObject.layer;
        }
    }