cc.Scene为什么不能调用getComponent, addComponent?

我的代码中在Scene节点上挂 了一些其它组件,然后就理所当然地去使用getComponent去获取,提示出错,追查了一下,发现有如下代码,在这两个函数调用时提示出错了,但是WHY? 那么这个需求要怎么做?
var ERR = ‘"%s" is not defined in the Scene, it is only defined in normal nodes.’;
CC_EDITOR || Object.defineProperties(cc.Scene.prototype, {
active: {
get: function () {
cc.error(ERR, ‘active’);
return true;
},
set: function () {
cc.error(ERR, ‘active’);
}
},
activeInHierarchy: {
get: function () {
cc.error(ERR, ‘activeInHierarchy’);
return true;
},
},
getComponent: {
get: function () {
cc.error(ERR, ‘getComponent’);
return function () {
return null;
};
}
},
addComponent: {
get: function () {
cc.error(ERR, ‘addComponent’);
return function () {
return null;
};
}
},
});

自己顶一下,麻烦官方大佬能出来解释下么?
cc.Scene是继承自cc.Node,cc.Node上可以调用这些接口,为什么在子类上要禁用掉?

同问 顶一顶

过去2年多了 没有任何回复。。。