private void ResetTemplate()
 {
     if (EditorUtility.DisplayDialog("Reset template?", "You cannot undo this action.", "Reset", "Cancel"))
     {
         template = Template.FromDefault();
         TemplateTools.SaveToEditorPrefs(template);
         Repaint();
     }
 }
        private void OnDisable()
        {
            if (debug)
            {
                Debug.Log("<color=orange>Dialogue Editor: OnDisable</color>");
            }
#if UNITY_2017_2_OR_NEWER
            EditorApplication.playModeStateChanged -= OnPlayModeStateChanged;
#else
            EditorApplication.playmodeStateChanged -= OnPlaymodeStateChanged;
#endif
            TemplateTools.SaveToEditorPrefs(template);
            inspectorSelection = null;
            instance           = null;
            SaveEditorSettings();
        }
 private void DrawTemplates()
 {
     EditorGUI.BeginChangeCheck();
     EditorWindowTools.StartIndentedSection();
     DrawTemplate("Actors", template.actorFields, template.actorPrimaryFieldTitles, ref templateFoldouts.actors);
     DrawTemplate("Items", template.itemFields, null, ref templateFoldouts.items);
     DrawTemplate("Quests", template.questFields, template.questPrimaryFieldTitles, ref templateFoldouts.quests);
     DrawTemplate("Locations", template.locationFields, null, ref templateFoldouts.locations);
     DrawTemplate("Variables", template.variableFields, null, ref templateFoldouts.variables);
     DrawTemplate("Conversations", template.conversationFields, template.conversationPrimaryFieldTitles, ref templateFoldouts.conversations);
     DrawTemplate("Dialogue Entries", template.dialogueEntryFields, template.dialogueEntryPrimaryFieldTitles, ref templateFoldouts.dialogueEntries);
     DrawDialogueLineColors();
     EditorWindowTools.EndIndentedSection();
     if (EditorGUI.EndChangeCheck())
     {
         TemplateTools.SaveToEditorPrefs(template);
     }
 }
예제 #4
0
 private void SaveTemplate()
 {
     TemplateTools.SaveToEditorPrefs(template);
     SaveTemplateToDatabase();
 }