static public void ExportActorsToCSVFile(string directory, Project project, List <Dialogue> dialogues, Language language, DateTime dateFrom)
        {
            string path = Path.Combine(directory, "Actors_" + project.GetName() + "_" + language.VoicingCode + ".csv");

            using (System.IO.StreamWriter file = new System.IO.StreamWriter(path, false, Encoding.UTF8))
            {
                //Name, Voice Actor, Species, Gender, Build, Age, Height, Personality, Voice Kit, ID
                {
                    ExporterCsv.CsvLineWriter header = new ExporterCsv.CsvLineWriter();
                    header.AddField("Name");
                    header.AddField("Voice Actor");
                    header.AddField("Species");
                    header.AddField("Gender");
                    header.AddField("Build");
                    header.AddField("Age");
                    header.AddField("Height");
                    header.AddField("Personality");
                    header.AddField("Voice Kit");
                    header.AddField("Actor ID");
                    header.WriteLine(file);
                }

                foreach (Actor actor in project.ListActors)
                {
                    string actorID     = actor.ID;
                    string name        = actor.Name;
                    string voiceActor  = project.GetLocalizedVoiceActorFromKit(actor.VoiceKit, language);
                    string voiceKit    = actor.VoiceKit;
                    string species     = actor.Species;
                    string gender      = actor.Gender;
                    string build       = actor.Build;
                    string age         = actor.Age.ToString();
                    string height      = actor.Height.ToString();
                    string personality = actor.Personality;

                    if (voiceActor == "")
                    {
                        voiceActor = project.GetVoiceActorNameFromKit(actor.VoiceKit);
                    }

                    //Name, Voice Actor, Species, Gender, Build, Age, Height, Personality, Voice Kit, ID
                    ExporterCsv.CsvLineWriter line = new ExporterCsv.CsvLineWriter();
                    line.AddField(name);
                    line.AddField(voiceActor);
                    line.AddField(species);
                    line.AddField(gender);
                    line.AddField(build);
                    line.AddField(age);
                    line.AddField(height);
                    line.AddField(personality);
                    line.AddField(voiceKit);
                    line.AddField(actorID);
                    line.WriteLine(file);
                }
            }
        }
        public static void CheckDialogueErrors(Dialogue dialogue)
        {
            Project project = ResourcesHandler.Project;

            if (!EditorCore.CustomLists["SceneTypes"].ContainsKey(dialogue.SceneType))
            {
                EditorCore.LogError(String.Format("{0} - Unknown Scene Type : {1}", dialogue.GetName(), dialogue.SceneType), dialogue);
            }

            if (!EditorCore.CustomLists["Cameras"].ContainsKey(dialogue.Camera))
            {
                EditorCore.LogError(String.Format("{0} - Unknown Camera : {1}", dialogue.GetName(), dialogue.Camera), dialogue);
            }

            var usedIDs = new HashSet <int>();

            foreach (DialogueNode node in dialogue.ListNodes)
            {
                if (usedIDs.Contains(node.ID))
                {
                    EditorCore.LogError(String.Format("{0} - Identical ID between two nodes : {1}", dialogue.GetName(), node.ID), dialogue, node);
                }
                else
                {
                    usedIDs.Add(node.ID);
                }

                if (node is DialogueNodeSentence)
                {
                    var  nodeSentence = node as DialogueNodeSentence;
                    bool validSpeaker = false;

                    if (nodeSentence.SpeakerID == "")
                    {
                        EditorCore.LogError(String.Format("{0} {1} - Sentence has no Speaker", dialogue.GetName(), node.ID), dialogue, node);
                    }
                    else
                    {
                        if (project.GetActorFromID(nodeSentence.SpeakerID) == null)
                        {
                            EditorCore.LogError(String.Format("{0} {1} - Sentence has an invalid Speaker : {2}", dialogue.GetName(), node.ID, nodeSentence.SpeakerID), dialogue, node);
                        }
                        else
                        {
                            validSpeaker = true;
                        }
                    }

                    if (nodeSentence.ListenerID != "")
                    {
                        if (project.GetActorFromID(nodeSentence.ListenerID) == null)
                        {
                            EditorCore.LogError(String.Format("{0} {1} - Sentence has an invalid Listener : {2}", dialogue.GetName(), node.ID, nodeSentence.ListenerID), dialogue, node);
                        }
                        else if (validSpeaker)
                        {
                            var speaker  = project.GetActorFromID(nodeSentence.SpeakerID);
                            var listener = project.GetActorFromID(nodeSentence.ListenerID);

                            if (speaker == listener)
                            {
                                EditorCore.LogError(String.Format("{0} {1} - Listener is also Speaker", dialogue.GetName(), node.ID), dialogue, node);
                            }
                            else
                            {
                                if (speaker.VoiceKit != String.Empty)
                                {
                                    if (speaker.VoiceKit == listener.VoiceKit)
                                    {
                                        EditorCore.LogWarning(String.Format("{0} {1} - Speaker and Listener have the same Voice Kit", dialogue.GetName(), node.ID), dialogue, node);
                                    }
                                    else if (project.GetVoiceActorNameFromKit(speaker.VoiceKit) == project.GetVoiceActorNameFromKit(listener.VoiceKit))
                                    {
                                        EditorCore.LogWarning(String.Format("{0} {1} - Speaker and Listener have the same Voice Actor", dialogue.GetName(), node.ID), dialogue, node);
                                    }
                                }
                            }
                        }
                    }

                    if (nodeSentence.Sentence.Length > project.MaxLengthSentence)
                    {
                        EditorCore.LogWarning(String.Format("{0} {1} - Sentence has too many characters", dialogue.GetName(), node.ID), dialogue, node);
                    }
                }
                else if (node is DialogueNodeChoice)
                {
                    var nodeChoice = node as DialogueNodeChoice;

                    if (nodeChoice.Replies.Count == 0)
                    {
                        EditorCore.LogError(String.Format("{0} {1} - Choice has no Reply", dialogue.GetName(), node.ID), dialogue, node);
                    }
                }
                else if (node is DialogueNodeReply)
                {
                    var nodeReply = node as DialogueNodeReply;

                    if (nodeReply.Reply.Length > project.MaxLengthReply)
                    {
                        EditorCore.LogWarning(String.Format("{0} {1} - Reply has too many characters", dialogue.GetName(), node.ID), dialogue, node);
                    }
                }
                else if (node is DialogueNodeGoto)
                {
                    var nodeGoto = node as DialogueNodeGoto;

                    if (nodeGoto.Goto == null)
                    {
                        EditorCore.LogError(String.Format("{0} {1} - Goto has no Target", dialogue.GetName(), node.ID), dialogue, node);
                    }
                }
                else if (node is DialogueNodeBranch)
                {
                    var nodeBranch = node as DialogueNodeBranch;

                    if (nodeBranch.Branch == null)
                    {
                        EditorCore.LogError(String.Format("{0} {1} - Branch has no Target", dialogue.GetName(), node.ID), dialogue, node);
                    }
                }
            }

            if (EditorCore.OnCheckDialogueErrors != null)
            {
                EditorCore.OnCheckDialogueErrors(dialogue);
            }
        }