mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
3f972a4d3c
* uuid-loader.js * Make camera-component is available in previewing; Remove onLoad of mesh asset class, instead do its content in model-component and skinning-model-component's _updateModels method. * define mesh its own format; improve the robust of gltf-utils; now the standard gltf can be imported * typo * bugfix * material serialization;gltf material import; fix animation component bug * cinnebt * remove skeleton root * small fix * bug fix * remove the hack materials * small fix
42 lines
939 B
JavaScript
42 lines
939 B
JavaScript
import Component from '../../components/CCComponent';
|
|
|
|
class RenderSystemActorListener {
|
|
constructor() {
|
|
this._renderSystem = null;
|
|
}
|
|
|
|
onRenderableComponentCreated(comp) {
|
|
if(this._renderSystem === null) {
|
|
this._renderSystem = cc.director._renderSystem;
|
|
}
|
|
comp._system = this._renderSystem;
|
|
if (this._renderSystem) {
|
|
comp._scene = this._renderSystem.scene;
|
|
}
|
|
}
|
|
}
|
|
|
|
let listener = new RenderSystemActorListener();
|
|
|
|
/**
|
|
* @class RenderSystemActor
|
|
* @extends Component
|
|
* RenderSystemActor is used to access Rendersystem
|
|
*/
|
|
export default class RenderSystemActor extends Component {
|
|
constructor() {
|
|
super();
|
|
this._system = null;
|
|
this._scene = null;
|
|
listener.onRenderableComponentCreated(this);
|
|
}
|
|
|
|
get renderSystem() {
|
|
return this._system;
|
|
}
|
|
|
|
get scene() {
|
|
return this._scene;
|
|
}
|
|
}
|