0
Fixed

Accessing "Get Scene Variable" in Prefab results in InvalidOperationException

Jöran Malek 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 6

Occurs if trying to enter variable name into Get Variable (Scene) on a prefab. Obviously there is no scene available if editing a prefab.

InvalidOperationException: Scene '' is invalid and cannot be used in singleton operations.
Ludiq.SceneSingleton`1[Bolt.SceneVariables].EnsureSceneValid (Scene scene) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Unity/SceneSingleton.cs:43)
Ludiq.SceneSingleton`1[Bolt.SceneVariables].InstanceIn (Scene scene) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Unity/SceneSingleton.cs:66)
Bolt.SceneVariables.Instance (Scene scene)
Bolt.SceneVariables.For (Scene scene)
Bolt.Variables.Scene (Scene scene)
Bolt.GetVariable.IsDefined ()
Bolt.ValueOutput.IsPredictable (Ludiq.Recursion recursion)
Bolt.ValueOutput.get_isPredictable ()
Bolt.UnitDescriptor`1+<ValueInputWarnings>d__30[Bolt.SetMember].MoveNext () (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Description/UnitDescriptor.cs:357)
Bolt.UnitDescriptor`1+<Warnings>d__29[Bolt.SetMember].MoveNext () (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Description/UnitDescriptor.cs:269)
System.Linq.Enumerable+<CreateCastIterator>c__Iterator0`1[System.Object].MoveNext ()
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[System.Object].MoveNext ()
System.Collections.Generic.List`1[System.Object].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[System.Object]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToArray[Object] (IEnumerable`1 source)
Ludiq.ConversionUtility.EnumerableToListConversion (System.Object value, System.Type listType) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:428)
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type, ConversionType conversionType) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:500)
Rethrow as InvalidConversionException: Failed to convert from 'Bolt.UnitDescriptor`1+<Warnings>d__29[Bolt.SetMember]' to 'System.Collections.Generic.List`1[Bolt.Warning]' via EnumerableToList.
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type, ConversionType conversionType) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:511)
Ludiq.ConversionUtility.Convert (System.Object value, System.Type type) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/ConversionUtility.cs:215)
Ludiq.DescriptionAssignment._Run (IDescriptor descriptor, IDescription description) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/DescriptionAssignment.cs:74)
Ludiq.DescriptionAssignment.Run (IDescriptor descriptor, IDescription description) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/DescriptionAssignment.cs:42)
Ludiq.Descriptor`2[TTarget,TDescription].Describe () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/Descriptor.cs:38)
Bolt.UnitDescriptor`1[TUnit].Describe () (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Description/UnitDescriptor.cs:42)
Ludiq.DescriptorProvider.GetDecorator (IDescribable decorated) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/DescriptorProvider.cs:32)
Ludiq.XDescriptorProvider.Descriptor (IDescribable target) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/DescriptorProvider.cs:62)
Ludiq.XDescriptorProvider.Description[UnitDescription] (IDescribable target) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Descriptors/DescriptorProvider.cs:77)
Bolt.XUnitDescription.Description (IUnit unit) (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Description/UnitDescription.cs:40)
Bolt.UnitWidget`1[Bolt.IUnit].Cache (Boolean manual) (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Units/UnitWidget.cs:99)
Ludiq.Widget`1[Bolt.IUnit].BeforeGUI ()
Ludiq.Canvas`1[TGraph].BeforeGUI ()
Ludiq.Canvas`1[TGraph].OnGraphGUI ()
Ludiq.GraphWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)
Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Pending Review

Hi Joran,

Which version are you using? Is this still an issue in v.1.2.3 alpha 3?

+1

Yes, it happened in v1.2.3-a3.

This is still not fixed in 1.2.3 Beta 1



Scene variables is currently unusable.