public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        ApplyLightmap_benja lightmapData = (ApplyLightmap_benja)target;

        if (GUILayout.Button("Load"))
        {
            lightmapData.Load();
        }
        if (GUILayout.Button("Save"))
        {
            if (lightmapData.CheckResourcesDirectoryExists(lightmapData.resourceFolder))
            {
                if (!EditorUtility.DisplayDialog("Overwrite Lightmap Resources?", "Lighmap Resources folder with name: \"" + lightmapData.resourceFolder + "\" already exists.\n\nPress OK to overwrite existing lightmap data.", "OK", "Cancel"))
                {
                    return;
                }
            }
            else
            {
                if (!EditorUtility.DisplayDialog("Create Lightmap Resources?", "Create new lighmap Resources folder: \"" + lightmapData.resourceFolder + "?", "OK", "Cancel"))
                {
                    return;
                }
            }
            lightmapData.GenerateLightmapInfoStore();
        }
    }
    private void Awake()
    {
        if (instance != null)
        {     // Singleton pattern.
            Destroy(gameObject);
        }
        else
        {
            instance = this;
        }

        if (loadOnAwake)
        {
            Load();
        }
    }