cc._renderType代表渲染模式:
// Canvas (cc.game.RENDER_TYPE_CANVAS 枚举值为0)
cc._renderType === cc.game.RENDER_TYPE_CANVAS
// WebGL (cc.game.RENDER_TYPE_CANVAS 枚举值为1)
cc._renderType === cc.game.RENDER_TYPE_WEBGL
例如:判断当前模式是否为WEBGL渲染模式
private isWebGL:boolean;
onLoad(){
let type = cc._renderType;
if (type === cc.game.RENDER_TYPE_CANVAS)
{
this.isWebGL = false;
}
else
{
this.isWebGL = true;
}
}