RockTomate / Issues

Submit bugs and feature requests.
4 stars 1 forks source link

Copied variables bank does not opens in another Unity version with null reference errors #11

Closed DmitriyYukhanov closed 4 years ago

DmitriyYukhanov commented 4 years ago

Steps to Reproduce

Expected Results If this is not allowed - would be nice to see some meaningful error message. Otherwise I expect it to work properly

Actual Results I see such errors in console:

NullReferenceException: Object reference not set to an instance of an object HardCodeLab.RockTomate.Editor.Controls.VariableTreeElement.set_Field (HardCodeLab.RockTomate.Core.Data.BaseField value) (at Assets/!Service/RockTomate/Scripts/Editor/Controls/TreeViews/Variables/VariableTreeElement.cs:20) HardCodeLab.RockTomate.Editor.Controls.VariableTreeElement..ctor (Int32 id, Int32 depth, HardCodeLab.RockTomate.Core.Data.BaseField field, Boolean isRoot) (at Assets/!Service/RockTomate/Scripts/Editor/Controls/TreeViews/Variables/VariableTreeElement.cs:71) HardCodeLab.RockTomate.Editor.Windows.VariableBankEditorWindow.GetVariableElements (System.Collections.Generic.List1 fields) (at Assets/!Service/RockTomate/Scripts/Editor/Windows/VariableBankEditorWindow.cs:163) HardCodeLab.RockTomate.Editor.Windows.VariableBankEditorWindow.Init () (at Assets/!Service/RockTomate/Scripts/Editor/Windows/VariableBankEditorWindow.cs:84) HardCodeLab.RockTomate.Editor.Windows.VariableBankEditorWindow.OnGUI () (at Assets/!Service/RockTomate/Scripts/Editor/Windows/VariableBankEditorWindow.cs:121) 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.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:107) UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at C:/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:182) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) `

ElmarTalibzade commented 4 years ago

Does the same occur if you move Jobs?

DmitriyYukhanov commented 4 years ago

Jobs still work fine and even able to read variables from such variable banks! =D

ElmarTalibzade commented 4 years ago

I would've been surprised if variable banks couldn't be read by Job: both are serialized in the same manner.

So this might be an Editor issue.

ElmarTalibzade commented 4 years ago

Closing this as minimum Unity version has been raised from 2017.4 to 2018.4.

Variable Banks do not throw errors when moving them between versions 2018.4.0f1 and 2020.1.0b8

ElmarTalibzade commented 4 years ago

Reopening the issue because I was testing with empty variable banks and that didn't cause any errors.

ElmarTalibzade commented 4 years ago

Fixed in 1.0.3.

Turns out this was a serialization issue between .NET Frameworks. Unfortunately, you'll have to re-create a variable bank for it to work in an older version.