I am trying to set some lua vars by choosing a random string from an array of strings residing in a ScriptableObject. I am getting this error:
Code: Select all
HasKey is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'DialogueEditorWindow'.
See "Script Serialization" page in the Unity Manual for further details.
UnityEditor.EditorPrefs:HasKey(String)
PixelCrushers.DialogueSystem.TemplateTools:LoadFromEditorPrefs()
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow:.ctor()
UnityEditor.EditorWindow:GetWindow(String)
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow:OpenDialogueEditorWindow()
PixelCrushers.DialogueSystem.DialogueDatabaseEditor:OpenDialogueEditorWindow()
PixelCrushers.DialogueSystem.DialogueDatabaseEditor:DrawExtraFeatures()
PixelCrushers.DialogueSystem.DialogueDatabaseEditor:OnInspectorGUI()
UnityEditor.DockArea:OnGUI()
Best!