Adding Support for Other Types

Manage Types Window for Easy Save 2You can attempt to automatically add support for a Type by going to the Assets menu and selecting Easy Save 2 > Manage Types. Then find the type you wish to add support for in the type list, select the properties of the type which you would like to save, and then press Add Type.

Easy Save can add support for types which provide a parameterless constructor, and can support properties which are:

  • Public
  • Non-static
  • Allows reading and writing
  • Is currently supported by Easy Save

For other types, you may be able to manually add support (see below).

If support cannot be automatically added for a Type, you may be able to manually add support for it.

The easiest way to do this is to create an ES2Type Template by going to to the Assets menu and selecting Easy Save 2 > Manage Types, finding your type in the type list and then pressing Add Type. Once you have done this, press Edit Type to open up the Type Template in your default editor so that you can edit it.

You will then need to change the Write and Read methods to include ES2Writer and ES2Reader calls.

Adding to the Write method

The Write method needs to write the data you want to save from the data variable into the ES2Writer. You can do this by using writer.Write() calls.

Note that the type of the data you are writing must also be a type supported by Easy Save.

Adding to the Read method

The Read method needs to read the data in the same order that it was written in the Write method using reader.Read<T>() calls, and then use that data to construct your loaded object and return it.