mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
30 lines
788 B
JavaScript
30 lines
788 B
JavaScript
import BaseSerializer from '../BaseSerializer';
|
|
import Object3DSerializer from '../core/Object3DSerializer';
|
|
import Cloth from '../../object/component/Cloth';
|
|
|
|
/**
|
|
* ClothSerializer
|
|
* @author tengge / https://github.com/tengge1
|
|
*/
|
|
function ClothSerializer() {
|
|
BaseSerializer.call(this);
|
|
}
|
|
|
|
ClothSerializer.prototype = Object.create(BaseSerializer.prototype);
|
|
ClothSerializer.prototype.constructor = ClothSerializer;
|
|
|
|
ClothSerializer.prototype.toJSON = function (obj) {
|
|
var json = Object3DSerializer.prototype.toJSON.call(this, obj);
|
|
|
|
return json;
|
|
};
|
|
|
|
ClothSerializer.prototype.fromJSON = function (json, parent, camera) {
|
|
var cloth = new Cloth();
|
|
|
|
Object3DSerializer.prototype.fromJSON.call(this, json, cloth);
|
|
|
|
return cloth;
|
|
};
|
|
|
|
export default ClothSerializer; |