Beispiel #1
0
        private void OnEnable()
        {
            if (debug)
            {
                Debug.Log("<color=green>Dialogue Editor: OnEnable (Selection.activeObject=" + Selection.activeObject + ", database=" + database + ")</color>", Selection.activeObject);
            }
            instance = this;
            template = TemplateTools.LoadFromEditorPrefs();
            minSize  = new Vector2(720, 240);
            if (Selection.activeObject != null)
            {
                SelectObject(Selection.activeObject);
            }
            else if (EditorWindow.focusedWindow == this)
            {
                SelectObject(database);
            }
            toolbar.UpdateTabNames(template.treatItemsAsQuests);
            if (database != null)
            {
                ValidateConversationMenuTitleIndex();
            }
#if UNITY_2017_2_OR_NEWER
            EditorApplication.playModeStateChanged -= OnPlayModeStateChanged;
            EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
#else
            EditorApplication.playmodeStateChanged -= OnPlaymodeStateChanged;
            EditorApplication.playmodeStateChanged += OnPlaymodeStateChanged;
#endif
            //nodeStyle = null;
            showQuickDialogueTextEntry = false;
            LoadEditorSettings();
        }
Beispiel #2
0
 void OnDisable()
 {
     EditorApplication.playmodeStateChanged -= OnPlaymodeStateChanged;
     template.SaveToEditorPrefs();
     inspectorSelection = null;
     instance           = null;
 }
        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();
        }
Beispiel #4
0
        void OnEnable()
        {
            //---Left in place to figure out in future how best to handle window resets when changing to playmode.
            //Debug.Log (string.Format("OnEnable(): database={0}, Selection.activeObject={1}, playing={2}", database, Selection.activeObject, Application.isPlaying));

            minSize = new Vector2(720, 240);
            CheckDatabase();
            if (toolbar == null)
            {
                toolbar = new Toolbar();
            }
            toolbar.UpdateTabNames(template.treatItemsAsQuests);
            if (database != null && conversationIndex >= database.conversations.Count)
            {
                conversationIndex = -1;
            }
            instance = this;
            EditorApplication.playmodeStateChanged += OnPlaymodeStateChanged;
        }
        private void OnEnable()
        {
            instance = this;
            minSize  = new Vector2(300, 240);
            database = DialogueEditorWindow.GetCurrentlyEditedDatabase();
            if (database == null)
            {
                EditorTools.FindInitialDatabase();
            }

            if (database == null && EditorPrefs.HasKey(DatabaseGUIDPrefsKey))
            {
                var guid = EditorPrefs.GetString(DatabaseGUIDPrefsKey);
                database = AssetDatabase.LoadAssetAtPath <DialogueDatabase>(guid);
            }
            template = TemplateTools.LoadFromEditorPrefs();
            if (variableView == null)
            {
                variableView = new DialogueEditorVariableView();
            }
            variableView.Initialize(database, template, false);
        }
Beispiel #6
0
 public void OnGUI()
 {
     try
     {
         if (instance == null)
         {
             instance = this;
         }
         RecordUndo();
         var isInNodeEditor = (toolbar.Current == Toolbar.Tab.Conversations) && showNodeEditor;
         if (!isInNodeEditor)
         {
             DrawDatabaseName();                  // Node editor draws name after grid.
         }
         DrawToolbar();
         DrawMainBody();
     }
     catch (System.ArgumentException)
     {
         // Not ideal to hide ArgumentException, but window can change layout during a repaint,
         // which can cause this exception.
     }
 }
        void OnEnable()
        {
            if (internalDebug) Debug.Log ("<color=lime>Enable</color>" + " savedInstanceID=" + databaseInstanceID);

            minSize = new Vector2(720, 240);
            CheckDatabase();
            if (toolbar == null) toolbar = new Toolbar();
            toolbar.UpdateTabNames(template.treatItemsAsQuests);
            if (database != null && conversationIndex >= database.conversations.Count) conversationIndex = -1;
            instance = this;
            EditorApplication.playmodeStateChanged += OnPlaymodeStateChanged;
        }
        void OnDisable()
        {
            if (internalDebug) Debug.Log ("<color=red>Disable</color>" + " savedInstanceID=" + databaseInstanceID);

            EditorApplication.playmodeStateChanged -= OnPlaymodeStateChanged;
            template.SaveToEditorPrefs();
            inspectorSelection = null;
            instance = null;
        }