0
Fixed

get_isPlaying is not allowed to be called during serialization

Arron Washington 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 4

Bolt 1.4 (.NET3 build), Unity 2018.1.4f1, .NET 4.6

I was fiddling with a state machine in play mode. I made a change and then exited play mode a second later.

I

Stack trace below:

get_isPlaying is not allowed to be called during serialization, call it from OnEnable instead. Called from ScriptableObject 'StateMacro'.
See "Script Serialization" page in the Unity Manual for further details.
UnityEditor.EditorApplication:get_isPlaying()
Ludiq.EditorTimeUtility:get_frame() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Utilities/EditorTimeUtility.cs:11)
Ludiq.<>c:<.cctor>b__5_1() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Utilities/EditorTimeUtility.cs:19)
Ludiq.EditorTimeBinding:get_frame() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/EditorBinding/EditorTimeBinding.cs:12)
Bolt.Flow:GetValue(ValueInput)
Bolt.Flow:FetchValue(ValueInput, GraphReference)
Bolt.Flow:FetchValue(ValueInput, Type, GraphReference)
Bolt.Flow:FetchValue(ValueInput, GraphReference)
Bolt.GameObjectEventUnit`1:UpdateTarget(GraphStack)
Bolt.GameObjectEventUnit`1:StartListening(GraphStack, Boolean)
Bolt.GameObjectEventUnit`1:StartListening(GraphStack)
Bolt.FlowGraph:StartListening(GraphStack)
Bolt.SuperUnit:StartListening(GraphStack)
Bolt.FlowGraph:StartListening(GraphStack)
Bolt.FlowStateTransition:StartListening(GraphStack)
Bolt.XGraphEventListener:StartListening(IGraphEventListener, GraphReference)
Bolt.XGraphEventListener:StartListeningIfHierarchyIsListening(IGraphEventListener, GraphReference)
Bolt.StateTransition:AfterAddOnInstance(GraphReference)
Ludiq.GraphElement`1:AfterAdd()
Ludiq.GraphElementCollection`1:AfterAdd(IStateTransition)
Ludiq.GraphConnectionCollection`3:AfterAdd(IStateTransition)
Ludiq.ConnectionCollectionBase`4:Add(IStateTransition)
Ludiq.VariantCollection`2:Add(IGraphElement) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Collections/VariantCollection.cs:45)
Ludiq.MergedKeyedCollection`2:Add(IGraphElement) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Collections/MergedKeyedCollection.cs:151)
Ludiq.Graph:OnAfterDependenciesDeserialized()
Ludiq.Serialization:CheckIfDependenciesMet(ISerializationDepender) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Serialization/Serialization.cs:235)
Ludiq.Serialization:AwaitDependencies(ISerializationDepender) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Serialization/Serialization.cs:204)
Ludiq.Graph:OnAfterDeserialize()
Ludiq.FullSerializer.fsSerializationCallbackReceiverProcessor:OnAfterDeserialize(Type, Object) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Dependencies/FullSerializer/fsISerializationCallbacks.cs:126)
Ludiq.FullSerializer.fsSerializer:Invoke_OnAfterDeserialize(List`1, Type, Object) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Dependencies/FullSerializer/fsSerializer.cs:1152)
Ludiq.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Dependencies/FullSerializer/fsSerializer.cs:637)
Ludiq.FullSerializer.fsReflectedConverter:TryDeserialize(fsData, Object&, Type) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Dependencies/FullSerializer/Converters/fsReflectedConverter.cs:97)
Ludiq.FullSerializer.fsSerializer:InternalDeserialize_5_Converter(Type, fsData, Type, Object&) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Dependencies/FullSerializer/fsSerializer.cs:861)
Ludiq.FullSerializer.fsSerializer:InternalDeserialize_4_Cycles(Type, fsData, Type, Object&) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Dependencies/FullSerializer/fsSerializer.cs:851)
Ludiq.FullSerializer.fsSerializer:InternalDeserialize_3_Inheritance(Type, fsData, Type, Object&, List`1&) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Dependencies/FullSerializer/fsSerializer.cs:826)
Ludiq.FullSerializer.fsSerializer:InternalDeserialize_2_Version(Type, fsData, Type, Object&, List`1&) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Dependencies/FullSerializer/fsSerializer.cs:730)
Ludiq.FullSerializer.fsSerializer:InternalDeserialize_1_CycleReference(Type, fsData, Type, Object&, List`1&) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Dependencies/FullSerializer/fsSerializer.cs:675)
Ludiq.FullSerializer.fsSerializer:TryDeserialize(fsData, Type, Type, Object&) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Dependencies/FullSerializer/fsSerializer.cs:628)
Ludiq.Serialization:DeserializeJson(fsSerializer, String, Object&, Boolean) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Serialization/Serialization.cs:166)
Ludiq.Serialization:DeserializeInto(SerializationData, Object&, Boolean) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Serialization/Serialization.cs:113)
Ludiq.LudiqScriptableObject:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Unity/LudiqScriptableObject.cs:48)

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Fixed

Could not reproduce specifically, but added a safety check based on the provided stack trace.

Will be pushed in hotfix today.