setting Lua Vars and ScriptableObject

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

setting Lua Vars and ScriptableObject

Post by mandi »

Hi Tony,
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()

How to fix that?
Best!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: setting Lua Vars and ScriptableObject

Post by Tony Li »

Hi Artur,

Please update to version 1.6.6.2. Sorry about the trouble. The Unity API changed.
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: setting Lua Vars and ScriptableObject

Post by mandi »

Hi Tony,
I suspected so, thanks for help!
Best!
Post Reply