Files
cocos4/cocos/3d/framework/renderSystemActor.js
T
Leslie Leigh 2f7d422519 refactor skinning and animating framework (#3399)
* * add onLoad() callback when asset is loaded;
* discard class SkeletonInstance, refactor skinning and animating framework
* discard interface AnimationResource and it's relevant classes, directly store animation clip data into AnimationClip asset
* add getNodeByPath() API to class Node

* uuid-loader.js

* bug fix

* 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.

* typo

* move _resetTarget() to onLoad
2018-10-25 10:29:07 +08:00

42 lines
940 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;
}
};