cocosCreator 全局对象用法,不用require 直接用

来源:互联网 发布:电路图软件下载 编辑:程序博客网 时间:2024/06/07 03:46
RMGameController.js
window.RMGameController= {
localClassName: {
default:"log_RMGameController",
},
testData: {
default: [],
type:Array
},
index:0,
initTestData:function (){
this.testData[0]=1;
this.testData[1]=2;
this.testData[2]=3;
this.testData[3]=4;
}
};



测试、
test.js
RMGameController.index++;