Page 1 of 1

Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Posted: Sun Sep 13, 2015 8:40 am
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

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Posted: Sun Sep 13, 2015 9:14 am
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

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Posted: Sun Sep 13, 2015 10:03 am
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;
	}

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Posted: Sun Sep 13, 2015 10:40 am
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

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Posted: Mon Sep 14, 2015 8:50 am
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

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Posted: Tue Oct 20, 2015 6:59 am
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 :)

Re: Crashes since Unity 5.2.0f3 and ES2 2.6.8p2

Posted: Tue Oct 20, 2015 7:15 am
by Joel
Great to hear, glad you got it sorted!

- Joel