public static DialogueDatabase CreateDialogueDatabaseInstance()
        {
            Template         template = Template.FromEditorPrefs();
            DialogueDatabase database = ScriptableObject.CreateInstance <DialogueDatabase>();

            database.actors.Add(template.CreateActor(1, "Player", true));
            database.variables.Add(template.CreateVariable(1, "Alert", string.Empty));
            return(database);
        }
        /// <summary>
        /// Converts the source into a dialogue database. This method does housekeeping such
        /// as creating the empty asset and saving it at the end, but the main work is
        /// done in the CopySourceToDialogueDatabase() method that you must implement.
        /// </summary>
        protected virtual void Convert()
        {
            DialogueDatabase database = LoadOrCreateDatabase();

            if (database == null)
            {
                Debug.LogError(string.Format("{0}: Couldn't create asset '{1}'.", DialogueDebug.Prefix, prefs.databaseFilename));
            }
            else
            {
                if (template == null)
                {
                    template = Template.FromEditorPrefs();
                }
                CopySourceToDialogueDatabase(database);
                TouchUpDialogueDatabase(database);
                EditorUtility.SetDirty(database);
                AssetDatabase.SaveAssets();
                Debug.Log(string.Format("{0}: Created database '{1}' containing {2} actors, {3} conversations, {4} items/quests, {5} variables, and {6} locations.",
                                        DialogueDebug.Prefix, prefs.databaseFilename, database.actors.Count, database.conversations.Count, database.items.Count, database.variables.Count, database.locations.Count));
            }
        }