Issue with Easy Save 3 and Unity 2021.1.0b7

Discussion and help for Easy Save 3
Post Reply
Aeuol
Posts: 4
Joined: Thu Mar 11, 2021 4:42 am

Issue with Easy Save 3 and Unity 2021.1.0b7

Post by Aeuol »

Hey I recently bought Easy Save 3 and attempted to use it with my project. This is the error I get after importing it.

Code: Select all

System.NullReferenceException: Object reference not set to an instance of an object
  at UnityEngine.UIElements.BaseLiveReloadAssetTracker`1[T].StartTrackingAsset (T asset) [0x0002b] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\BaseLiveReloadAssetTracker.cs:47 
  at UnityEngine.UIElements.VisualElement.HandlePanelAttachmentEvents (UnityEngine.UIElements.EventBase evt) [0x00089] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\VisualElementHierarchy.cs:1056 
  at UnityEngine.UIElements.VisualElement.ExecuteDefaultAction (UnityEngine.UIElements.EventBase evt) [0x000c4] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\VisualElement.cs:1040 
  at UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) [0x00079] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\Events\EventHandler.cs:170 
  at UnityEngine.UIElements.EventDispatchUtilities.ExecuteDefaultAction (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) [0x00039] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\Events\IEventDispatchingStrategy.cs:213 
  at UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) [0x0009a] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\EventDispatcher.cs:356 
  at UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) [0x0002e] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\EventDispatcher.cs:218 
  at UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) [0x0000e] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\Panel.cs:398 
  at UnityEngine.UIElements.VisualElement.HasChangedPanel (UnityEngine.UIElements.BaseVisualElementPanel prevPanel) [0x0004b] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\VisualElement.cs:1155 
  at UnityEngine.UIElements.VisualElement.SetPanel (UnityEngine.UIElements.BaseVisualElementPanel p) [0x00148] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\VisualElement.cs:1114 
  at UnityEngine.UIElements.VisualElement+Hierarchy.SetParent (UnityEngine.UIElements.VisualElement value) [0x0001b] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\VisualElementHierarchy.cs:661 
  at UnityEngine.UIElements.VisualElement+Hierarchy.Insert (System.Int32 index, UnityEngine.UIElements.VisualElement child) [0x000b4] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\VisualElementHierarchy.cs:440 
  at UnityEngine.UIElements.VisualElement+Hierarchy.Add (UnityEngine.UIElements.VisualElement child) [0x0000e] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\VisualElementHierarchy.cs:402 
  at UnityEngine.UIElements.VisualElement.Add (UnityEngine.UIElements.VisualElement child) [0x0001d] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\VisualElementHierarchy.cs:98 
  at UnityEditor.UIElements.DefaultEditorWindowBackend.AddRootElement (UnityEngine.UIElements.VisualElement root) [0x00000] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Editor\WindowBackends\DefaultEditorWindowBackend.cs:163 
  at UnityEditor.UIElements.DefaultEditorWindowBackend.RegisterWindow () [0x000ab] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Editor\WindowBackends\DefaultEditorWindowBackend.cs:126 
  at UnityEditor.UIElements.DefaultEditorWindowBackend.UnityEditor.IEditorWindowBackend.OnRegisterWindow () [0x00000] in D:\Unity Rpos\Idle Castle Defender\Library\PackageCache\com.unity.ui@1.0.0-preview.14\Editor\WindowBackends\DefaultEditorWindowBackend.cs:97 
  at UnityEditor.HostView.RegisterSelectedPane (System.Boolean sendEvents) [0x00035] in <4692de163886420a99055edcb981b14c>:0 
  at UnityEditor.HostView.SetActualViewInternal (UnityEditor.EditorWindow value, System.Boolean sendEvents) [0x0004b] in <4692de163886420a99055edcb981b14c>:0 
  at UnityEditor.DockArea.SetSelectedPrivate (System.Int32 value, System.Boolean sendEvents) [0x00059] in <4692de163886420a99055edcb981b14c>:0 
  at UnityEditor.DockArea.AddTab (System.Int32 idx, UnityEditor.EditorWindow pane, System.Boolean sendPaneEvents) [0x00018] in <4692de163886420a99055edcb981b14c>:0 
  at UnityEditor.DockArea.AddTab (UnityEditor.EditorWindow pane, System.Boolean sendPaneEvents) [0x0000d] in <4692de163886420a99055edcb981b14c>:0 
  at UnityEditor.EditorWindow.CreateNewWindowForEditorWindow (UnityEditor.EditorWindow window, System.Boolean loadPosition, System.Boolean showImmediately, System.Boolean setFocus) [0x0001b] in <4692de163886420a99055edcb981b14c>:0 
  at UnityEditor.EditorWindow.Show (System.Boolean immediateDisplay) [0x00011] in <4692de163886420a99055edcb981b14c>:0 
  at UnityEditor.EditorWindow.Show () [0x00001] in <4692de163886420a99055edcb981b14c>:0 
  at UnityEditor.EditorWindow.GetWindowPrivate (System.Type t, System.Boolean utility, System.String title, System.Boolean focus) [0x00057] in <4692de163886420a99055edcb981b14c>:0 
  at UnityEditor.EditorWindow.GetWindow (System.Type t) [0x00001] in <4692de163886420a99055edcb981b14c>:0 
  at ES3Editor.ES3Window.InitAndShowHome () [0x00000] in D:\Unity Rpos\Idle Castle Defender\Assets\Plugins\Easy Save 3\Editor\ES3Window.cs:25 
  at ES3Editor.ES3Window.OpenEditorWindowOnStart () [0x0000d] in D:\Unity Rpos\Idle Castle Defender\Assets\Plugins\Easy Save 3\Editor\ES3Window.cs:183 
  at ES3Postprocessor..cctor () [0x00000] in D:\Unity Rpos\Idle Castle Defender\Assets\Plugins\Easy Save 3\Editor\ES3Postprocessor.cs:39 
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes (System.Type[])
Is there a fix to this? Would love to implement it. Thank you.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Issue with Easy Save 3 and Unity 2021.1.0b7

Post by Joel »

Hi there,

Unfortunately we can't support beta versions of Unity as they are known to be very unstable. This particular error is actually within Unity's own API rather than ours (it's just triggered by the EditorWindow.GetWindow method that we call), so you might want to report this to them as a bug.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Aeuol
Posts: 4
Joined: Thu Mar 11, 2021 4:42 am

Re: Issue with Easy Save 3 and Unity 2021.1.0b7

Post by Aeuol »

Gotcha thanks for the quick reply.
Rudi
Posts: 2
Joined: Tue Mar 30, 2021 12:28 pm

Re: Issue with Easy Save 3 and Unity 2021.1.0b7

Post by Rudi »

Hey there,

I experienced the same issue on the official 2021.1.0f1 release of unity.

I also found a workaround.

1. save your project before you do this, do a backup if you feel like it!

2. goto ES3Window.cs line 22

3. Comment the contents of the InitAndShowHome() function.

4. Go back to the Editor (it might crash at this point), just restart it and it should be fine.

5. Enter Play mode one time.

6. Uncommend the changes and you are good to go.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Issue with Easy Save 3 and Unity 2021.1.0b7

Post by Joel »

Hi there,

Thanks for the information. I still don't appear to be able to replicate this at my end. If you get a chance, please could you send a bug report to Unity regarding this as this will be an issue at their end?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Rudi
Posts: 2
Joined: Tue Mar 30, 2021 12:28 pm

Re: Issue with Easy Save 3 and Unity 2021.1.0b7

Post by Rudi »

Hey Joel,

I have not looked into it too much, but to quickly guess what is going on.

The EditorWindow.GetWindow() function should not return null, but create a new window instead (I guess something goes wrong when it tries to do so).
https://docs.unity3d.com/2021.1/Documen ... indow.html

So it seems to return null anyways at least in 2021.1.f01, so that's probably the bug report to unity.

However,

a bug report means a fix maybe comes around when unity does something about it, which can take unpredictably long.

I think you could fix it on your end by adding some ? null checks:

public static void InitAndShowHome()
{
// Get existing open window or if none, make a new one:
ES3Window window = (ES3Window)EditorWindow.GetWindow(typeof(ES3Window));
window?.Show();
window?.SetCurrentWindow(typeof(HomeWindow));
}

Btw. Thanks for creating and supporting the asset!
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Issue with Easy Save 3 and Unity 2021.1.0b7

Post by Joel »

Hi there,

We'll indeed at a null check as a workaround, but unfortunately this will still prevent some things from working :( Ultimately it'll be up to Unity to fix their bug.

Thanks for your assistance on this :)

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply