ES2.LoadObject

public static object LoadObject(string path, ES2Settings settings=null)

Parameters

[table th=”0″]path,”The path where our data is stored. For more information, see Paths.”

settings,”Optional. A user-created ES2Settings object containing options not specified in path.”[/table]

Returns

[table th=”0″]object,”Our loaded data as a System.Object”[/table]

Description

Loads the data of from a file as a System.Object.

Note that this is not a method of loading references, but is simply an ES2.Load method without the generic parameter. Data should be cast to a System.Object afterwards.

C#

// Save the position of this GameObject.
ES2.Save(transform.position, "myFile.txt?tag=myPosition");
  
// Load the position we saved and assign it to this GameObject.
transform.position = (Vector3)ES2.LoadObject("myFile.txt?tag=myPosition");

JS

// Save the position of this GameObject.
ES2.Save(transform.position, "myFile.txt?tag=myPosition");
  
// Load the position we saved and assign it to this GameObject.
transform.position = (Vector3)ES2.LoadObject("myFile.txt?tag=myPosition");