/// <summary>
        /// Loads the dialogue database if it already exists and overwrite is ticked; otherwise creates a new one.
        /// </summary>
        /// <returns>
        /// The database.
        /// </returns>
        /// <param name='filename'>
        /// Asset filename.
        /// </param>
        private DialogueDatabase LoadOrCreateDatabase(string filename)
        {
            var assetPath = prefs.OutputFolder;

            if (!assetPath.EndsWith("/"))
            {
                assetPath += "/";
            }
            assetPath += filename + ".asset";
            DialogueDatabase database = null;

            if (prefs.Overwrite)
            {
                database = AssetDatabase.LoadAssetAtPath(assetPath, typeof(DialogueDatabase)) as DialogueDatabase;
                if (database != null)
                {
                    database.Clear();
                }
            }
            if (database == null)
            {
                assetPath = AssetDatabase.GenerateUniqueAssetPath(string.Format("{0}/{1}.asset", prefs.OutputFolder, filename));
                database  = DatabaseUtility.CreateDialogueDatabaseInstance();
                AssetDatabase.CreateAsset(database, assetPath);
            }
            return(database);
        }