private void UserDefinedLookup(LBTerrainGrass lbTerrainGrass, string sourceName)
        {
            if (lbGrassSetup == null)
            {
                Debug.LogWarning("LandscapeBuilderGrassEditor.UserDefinedLookup - Grass Setup is not defined");
            }
            else if (lbTerrainGrass == null)
            {
                Debug.LogWarning("LandscapeBuilderGrassEditor.UserDefinedLookup - Terrain Grass cannot be null");
            }
            else
            {
                string filePath = LBTextureOperations.GetTextureFilePath(lbTerrainGrass.texture);
                string textureNameWithExtension = LBTextureOperations.GetTextureFileNameFromPath(filePath);

                // Find a match in the current config list
                LBGrassConfig lbGrassConfig = lbGrassSetup.lbGrassConfigList.Find(g => g.grassTextureName == textureNameWithExtension && g.sourceName == sourceName);

                // If we didn't find a match, create a new one
                if (lbGrassConfig == null)
                {
                    AddGrassConfig(lbTerrainGrass, textureNameWithExtension);
                }
            }
        }
 /// <summary>
 /// Add a new LBGrassConfig using an existing LBTerrainGrass instance
 /// </summary>
 /// <param name="lbTerrainGrass"></param>
 private void AddGrassConfig(LBTerrainGrass lbTerrainGrass, string textureName)
 {
     if (lbGrassSetup == null)
     {
         Debug.LogWarning("LandscapeBuilderGrassEditor.AddGrassConfig - Grass Setup is not defined");
     }
     else if (lbTerrainGrass == null)
     {
         Debug.LogWarning("LandscapeBuilderGrassEditor.AddGrassConfig - Terrain Grass cannot be null");
     }
     else if (lbGrassSetup.lbGrassConfigList == null)
     {
         Debug.LogWarning("LandscapeBuilderGrassEditor.AddGrassConfig - GrassConfigList is not defined");
     }
     else
     {
         LBGrassConfig lbGrassConfigNew = new LBGrassConfig();
         if (lbGrassConfigNew != null)
         {
             lbGrassConfigNew.sourceName           = LBGrassSetup.UserDefinedSourceFilter;
             lbGrassConfigNew.texture2D            = lbTerrainGrass.texture;
             lbGrassConfigNew.grassTexturePath     = AssetDatabase.GetAssetPath(lbTerrainGrass.texture);
             lbGrassConfigNew.grassTextureName     = LBTextureOperations.GetTextureFileNameFromPath(lbGrassConfigNew.grassTexturePath);
             lbGrassConfigNew.detailRenderMode     = lbTerrainGrass.detailRenderMode;
             lbGrassConfigNew.dryColour            = lbTerrainGrass.dryColour;
             lbGrassConfigNew.grassPatchFadingMode = (LBGrassConfig.GrassPatchFadingMode)lbTerrainGrass.grassPatchFadingMode;
             lbGrassConfigNew.healthyColour        = lbTerrainGrass.healthyColour;
             lbGrassConfigNew.minWidth             = lbTerrainGrass.minWidth;
             lbGrassConfigNew.maxWidth             = lbTerrainGrass.maxWidth;
             lbGrassConfigNew.minHeight            = lbTerrainGrass.minHeight;
             lbGrassConfigNew.maxHeight            = lbTerrainGrass.maxHeight;
             lbGrassSetup.lbGrassConfigList.Add(lbGrassConfigNew);
             lbGrassSetup.Save(false);
             if (lbWindow != null)
             {
                 lbWindow.isGrassConfigListDirty = true;
             }
         }
     }
 }