TileScript.GetGrassChild C# (CSharp) Method

GetGrassChild() private method

Gets the child grass covering for this tile, if it exists.
private GetGrassChild ( ) : GameObject
return GameObject
    GameObject GetGrassChild()
    {
        for (int i = 0; i < transform.childCount; ++i)
        {
            var c = transform.GetChild(i);
            if (c.CompareTag("Tile"))
            {
                return c.gameObject;
            }
        }

        return null;
    }