@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
2 lines (1 loc) • 1.22 kB
JavaScript
import{Component as i}from"../component.js";import{ComponentSystem as t}from"../system.js";import{LayoutChildComponent as o}from"./component.js";import{LayoutChildComponentData as e}from"./data.js";const n=["enabled"];class d extends t{constructor(i){super(i),this.id="layoutchild",this.ComponentType=o,this.DataType=e,this.schema=n}initializeComponentData(i,t,o){void 0!==t.enabled&&(i.enabled=t.enabled),void 0!==t.minWidth&&(i.minWidth=t.minWidth),void 0!==t.minHeight&&(i.minHeight=t.minHeight),void 0!==t.maxWidth&&(i.maxWidth=t.maxWidth),void 0!==t.maxHeight&&(i.maxHeight=t.maxHeight),void 0!==t.fitWidthProportion&&(i.fitWidthProportion=t.fitWidthProportion),void 0!==t.fitHeightProportion&&(i.fitHeightProportion=t.fitHeightProportion),void 0!==t.excludeFromLayout&&(i.excludeFromLayout=t.excludeFromLayout),super.initializeComponentData(i,t,o)}cloneComponent(i,t){const o=i.layoutchild;return this.addComponent(t,{enabled:o.enabled,minWidth:o.minWidth,minHeight:o.minHeight,maxWidth:o.maxWidth,maxHeight:o.maxHeight,fitWidthProportion:o.fitWidthProportion,fitHeightProportion:o.fitHeightProportion,excludeFromLayout:o.excludeFromLayout})}}i._buildAccessors(o.prototype,n);export{d as LayoutChildComponentSystem};