serializableObject.ts 520 B

12345678910111213141516171819202122
  1. /// <reference path="../core/common/GameObject.ts" />
  2. /**
  3. * You might need to update the path (first line of this file) and replace every mention of `Example` with your class name
  4. */
  5. class Example extends GameObject{
  6. //#region SYSTEM
  7. constructor(){super()}
  8. clone = function () {
  9. return (new setup.Example())._init(this.clonableFields);
  10. };
  11. toJSON = function () {
  12. return JSON.reviveWrapper('(new setup.Example())._init($ReviveData$)', this.ownData);
  13. };
  14. //#endregion
  15. }
  16. setup.Example = Example;