找了一下,原生的渲染是在jsb-engine.js 最后面 这一段实现的,所以原生这个组件用不了,因为渲染都不走上面覆写的代码了
var RenderFlow = cc.RenderFlow;
RenderFlow.FLAG_REORDER_CHILDREN = 1 << 29;
RenderFlow.FLAG_WORLD_TRANSFORM_CHANGED = 1 << 30;
RenderFlow.FLAG_OPACITY_CHANGED = 1 << 31;
var _dirtyTargets = [];
var _dirtyWaiting = [];
var _rendering = false;
var director = cc.director;
RenderFlow.render = function (scene) {
_rendering = true;
for (var i = 0, l = _dirtyTargets.length; i < l; i++) {
var node = _dirtyTargets[i];
node._inRenderList = false;
var comp = node._renderComponent;
if (!comp) continue;
var assembler = comp._assembler;
if (!assembler) continue;
var flag = node._dirtyPtr[0];
if (flag & RenderFlow.FLAG_UPDATE_RENDER_DATA) {
node._dirtyPtr[0] &= ~RenderFlow.FLAG_UPDATE_RENDER_DATA;
assembler._updateRenderData && assembler._updateRenderData();
}
if (flag & RenderFlow.FLAG_COLOR) {
node._dirtyPtr[0] &= ~RenderFlow.FLAG_COLOR;
comp._updateColor && comp._updateColor();
}
}
_dirtyTargets.length = 0;
this._nativeFlow.render(scene._proxy, director._deltaTime);
_dirtyTargets = _dirtyWaiting.slice(0);
_dirtyWaiting.length = 0;
_rendering = false;
};
RenderFlow.init = function (nativeFlow) {
cc.EventTarget.call(this);
this._nativeFlow = nativeFlow;
};
RenderFlow.register = function (target) {
if (target._inRenderList) return;
if (_rendering) {
_dirtyWaiting.push(target);
} else {
_dirtyTargets.push(target);
}
target._inRenderList = true;
};
@wercfz
@hx947621385