我有一个如下的对象设置:
var StartScreenLayer = cc.Layer.extend({
ctor: function () {
this._super();
// this function can call createBackground!
this.createBackground();
},
callCreateBackgroundToo: function () {
// I can call createBackground too!
this.createBackground();
},
createBackground: function () {
});
如何安排它以使 createBackground 是私有的,但其他其他对象不能调用类似的东西screenLayer.createBackground()
并在对象上引发createBackground is undefined
类型错误?