This is the solution.
const CONSTANT_VAR = 10;
const CONSTANT_STRING = "StringValue";
var ContantClass = cc.Class( {
extends: Component,
properties:{
number: 0,
name: "",
},
GetConstantVar: function(){
return CONSTANT_VAR;
}
GetConstantString: function(){
return CONSTANT_STRING;
}
foo: function(){
console.log(this.GetConstantVar());
}
boo: function(){
var value = CONSTANT_VAR;
console.log(value);
}
poo: function(){
console.log(this.GetConstantString());
}
coo: function(){
console.log(CONSTANT_STRING);
}
)};
cocos creator unexpected element <queries> found in AndroidManifest.xml (0) | 2021.05.17 |
---|---|
SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727) (0) | 2021.05.07 |
cocos Failed to notify project evaluation listener. java.lang.exceptionInInitializerError (0) | 2021.05.07 |
[cocos creator js ] how to UI Components , button Hide & Active ? (0) | 2021.04.16 |
how to cocos creator single ton via Javascript (0) | 2021.04.15 |
cocos creator js (0) | 2021.04.09 |