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?
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?
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.
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.
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/