NUnit framework?

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
drillowiz
Posts: 3
Joined: Thu May 31, 2018 10:47 am

NUnit framework?

Post by drillowiz »

I'm trying to add List to the saveable types in my project. Upon clicking Add type for List in Assets - > Easy save 2 -> Manage Types, I get the following error:
Assets/Easy Save 2/Types/ES2UserType_NUnitFrameworkList.cs(4,7): error CS0246: The type or namespace name `NUnit' could not be found. Are you missing an assembly reference?
This is the affiliated script:

Code: Select all

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using NUnit.Framework;

public class ES2UserType_NUnitFrameworkList : ES2Type
{
	public override void Write(object obj, ES2Writer writer)
	{
		NUnit.Framework.List data = (NUnit.Framework.List)obj;
		// Add your writer.Write calls here.

	}
	
	public override object Read(ES2Reader reader)
	{
		NUnit.Framework.List data = new NUnit.Framework.List();
		Read(reader, data);
		return data;
	}

	public override void Read(ES2Reader reader, object c)
	{
		NUnit.Framework.List data = (NUnit.Framework.List)c;
		// Add your reader.Read calls here to read the data into the object.

	}
	
	/* ! Don't modify anything below this line ! */
	public ES2UserType_NUnitFrameworkList():base(typeof(NUnit.Framework.List)){}
}
What am I missing here? What is NUnit.Framework, and how do i find it?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: NUnit framework?

Post by Joel »

Hi there,

As I'm unfamiliar with NUnit, I'm afraid I can only provide limited assistance. However, if you PM me a very basic project (only containing NUnit, Easy Save and your ES2UserType), I'll see if I can work out what is happening. However, as it is an issue with their API being inaccessible, you might be better off contacting them regarding this.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
drillowiz
Posts: 3
Joined: Thu May 31, 2018 10:47 am

Re: NUnit framework?

Post by drillowiz »

Sorry, I realise I was unclear in my last post. Visual studio is telling me that it can't find the NUnit.Framework namespace in the top of the script. It was added by defeault when i clicked Edit Type in Easy Save 2 -> Manage Types. So I'm not sure how to add it in a project.

Being a rather novice coder, I have no clue as to what NUnit is or why it's there, I have never seen this namespace before.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: NUnit framework?

Post by Joel »

Hi there,

You've tried to add support for the NUnitFrameworkList class, not a List. You will need to delete the ES2Type and then go to Manage Types and press the Refresh ES2Init button.

Lists of supported types are natively supported by Easy Save and do not need to be added in Manage Types. You can find a list of natively supported types in the Supported Types page:
https://docs.moodkie.com/easy-save-2/supported-types/

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
drillowiz
Posts: 3
Joined: Thu May 31, 2018 10:47 am

Re: NUnit framework?

Post by drillowiz »

Ok, I see... I think :) I will try to proceed as you suggested.

Edit: It seems to be working now!

Thank you Joel!
Locked