forked from playcanvas/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem.js
More file actions
48 lines (37 loc) · 1.3 KB
/
system.js
File metadata and controls
48 lines (37 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { Component } from '../component.js';
import { ComponentSystem } from '../system.js';
import { ScrollbarComponent } from './component.js';
import { ScrollbarComponentData } from './data.js';
const _schema = [
{ name: 'enabled', type: 'boolean' },
{ name: 'orientation', type: 'number' },
{ name: 'value', type: 'number' },
{ name: 'handleSize', type: 'number' },
{ name: 'handleEntity', type: 'entity' }
];
/**
* @class
* @name ScrollbarComponentSystem
* @augments ComponentSystem
* @classdesc Manages creation of {@link ScrollbarComponent}s.
* @description Create a new ScrollbarComponentSystem.
* @param {Application} app - The application.
*/
class ScrollbarComponentSystem extends ComponentSystem {
constructor(app) {
super(app);
this.id = 'scrollbar';
this.ComponentType = ScrollbarComponent;
this.DataType = ScrollbarComponentData;
this.schema = _schema;
this.on('beforeremove', this._onRemoveComponent, this);
}
initializeComponentData(component, data, properties) {
super.initializeComponentData(component, data, _schema);
}
_onRemoveComponent(entity, component) {
component.onRemove();
}
}
Component._buildAccessors(ScrollbarComponent.prototype, _schema);
export { ScrollbarComponentSystem };