Page 1 of 1

setting Lua Vars and ScriptableObject

Posted: Thu Aug 11, 2016 1:20 pm
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!

Re: setting Lua Vars and ScriptableObject

Posted: Thu Aug 11, 2016 2:38 pm
by Tony Li
Hi Artur,

Please update to version 1.6.6.2. Sorry about the trouble. The Unity API changed.

Re: setting Lua Vars and ScriptableObject

Posted: Fri Aug 12, 2016 4:58 am
by mandi
Hi Tony,
I suspected so, thanks for help!
Best!