Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
McGravity
Posts: 19
Joined: Sun Aug 02, 2015 12:56 pm

Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Post by McGravity »

Hey there,

most of the time my Unity3D will crash completely (freez -> win looking for problems -> closes itself).

Sometimes, presumably when debugging and trying to find the error, it will give exceptions instead of
crashing:

Self-Assigning Load is not supported on Types of Namespace.To.My.Class.
Type must not be a value type, and must have a parameterless constructor.

The exception is pretty clear, but I don't believe that this is the problem. The ES2init.cs is looking fine,
all classes for which I receive the above error are within it. Any idea what could possibly go wrong since those
two updates from the subject? I rather think it's from the ES2 update as this came out yesterday. I updated to
the most current unity version immediately.

best regards

User avatar
Joel
Moodkie Staff
Posts: 3724
Joined: Wed Nov 07, 2012 10:32 pm

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Post by Joel »

Hi there,

The ES2 2.6.8p2 update only made changes to the WP8/WSA functionality, so it shouldn't affect any other platforms.

Please could I see the code you're using and the ES2Type for the type in question (this can be found in Assets/Easy Save 2/Types)? As the error message suggests, this error usually occurs when you try to use self-assigning load on a value type. i.e.
// This would throw the Self-Assigning load exception.
Vector3 vector3 = new Vector3(1,2,3);
ES2.Load<Vector3>( "myData",  vector3);
All the best,
Joel

McGravity
Posts: 19
Joined: Sun Aug 02, 2015 12:56 pm

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Post by McGravity »

TreeClass tree = woodObject.transform.GetChild(i).gameObject.GetComponent<TreeClass>();
reader.Read<TreeClass>(tree);

And here the read method from the ES2UserType class:

public override void Read(ES2Reader reader, Component c) {
		/* ... code here ... */
	}
	
	/* ! Don't modify anything below this line ! */
	
	public ES2UserType_AssetsScriptsNatureFloraWoodTreeClass():base(typeof(Assets.Scripts.Nature.Flora.Wood.TreeClass)){}
	
	public override object Read(ES2Reader reader) {
		Assets.Scripts.Nature.Flora.Wood.TreeClass param = GetOrCreate<Assets.Scripts.Nature.Flora.Wood.TreeClass>();
		Read(reader, param);
		return param;
	}
Last edited by McGravity on Mon Sep 14, 2015 8:51 am, edited 1 time in total.

User avatar
Joel
Moodkie Staff
Posts: 3724
Joined: Wed Nov 07, 2012 10:32 pm

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Post by Joel »

Hi there,

Please could you change your method stub to public override void Read(ES2Reader reader, System.Object c) and see if that fixes your problem?

Unity is meant to route it to the Read(reader, object) stub automatically, but it might be that there's a bug at their end which stops this from happening in 5.2.0f3, which we've not yet discovered.

All the best,
Joel

McGravity
Posts: 19
Joined: Sun Aug 02, 2015 12:56 pm

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Post by McGravity »

As a matter of fact that worked! :)
Sometimes Unity is still crashing, but when not, no self-assign exceptions are thrown.
I'll dig further into that problem and will post here if I find anything out.

Thanks a lot!

greetings

McGravity
Posts: 19
Joined: Sun Aug 02, 2015 12:56 pm

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Post by McGravity »

Hey there, I found out it has to do with Precomputed Relatime GI and loading a scene:
http://forum.unity3d.com/threads/unity- ... gi.362001/

So nothing wrong with EasySave :)

User avatar
Joel
Moodkie Staff
Posts: 3724
Joined: Wed Nov 07, 2012 10:32 pm

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Post by Joel »

Great to hear, glad you got it sorted!

- Joel

Locked