Skip to content

Serialization

Mishin870 edited this page Jul 27, 2018 · 5 revisions

You can serialize compiled script to increase loading speed (run it without syntax processing)

Serialization

//The last argument specifies whether serialization should be optimized for the client part (c++)
script.serialize(Engine, Stream, false);

DeSerialization

Script script = engine.loadScript(Stream);

Example

using (FileStream stream = new FileStream("test.script", FileMode.Create, FileAccess.Write)) {
	script.serialize(stream);
}
using (FileStream stream = new FileStream("test.script", FileMode.Open, FileAccess.Read)) {
	script = engine.loadScript(stream);
}
Clone this wiki locally