mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
2f7d422519
* * 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
42 lines
940 B
JavaScript
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;
|
|
}
|
|
};
|