Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/_test.sim/simulation/components/test-serialize.js
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
TestScript1_custom.prototype.Init = function() { | TestScript1_custom.prototype.Init = function() { | ||||
this.y = 2; | this.y = 2; | ||||
}; | }; | ||||
TestScript1_custom.prototype.Serialize = function() { | TestScript1_custom.prototype.Serialize = function() { | ||||
return {c:1}; | return {c:1}; | ||||
}; | }; | ||||
TestScript1_custom.prototype.Deserialize = function(data) { | |||||
this.c = data.c; | |||||
}; | |||||
Engine.RegisterComponentType(IID_Test1, "TestScript1_custom", TestScript1_custom); | Engine.RegisterComponentType(IID_Test1, "TestScript1_custom", TestScript1_custom); | ||||
// -------- // | // -------- // | ||||
function TestScript1_getter() {} | function TestScript1_getter() {} | ||||
TestScript1_getter.prototype.Init = function() { | TestScript1_getter.prototype.Init = function() { | ||||
this.x = 100; | this.x = 100; | ||||
Show All 16 Lines |
Wildfire Games · Phabricator