
cc.Class({
    extends: cc.Component,

    properties: {
        is_debug:false,//是否开启调试
        gravity:cc.v2(0,-320),//引擎默认的重力
    },

// 开启物理引擎 必须写在onload ，否则无效
    onLoad () {
        //开启物理引擎
        cc.director.getPhysicsManager().enabled=true
        // cc.director.getCollisionManager().enabled = true;
        // cc.director.getCollisionManager().enabledDebugDraw  = true;
        // cc.director.getCollisionManager().enabledDrawBoundingBox   = true;

        //开启重力
        cc.director.getPhysicsManager().gravity=this.gravity

        //配置调试区域

        if (this.is_debug){
            let Bits  = cc.PhysicsManager.DrawBits;
            cc.director.getPhysicsManager().debugDrawFlags = Bits .e_aabbBit | Bits .e_pairBit | Bits .e_centerOfMassBit |
                Bits .e_jointBit | Bits .e_shapeBit;
        }else {
            cc.director.getPhysicsManager().debugDrawFlags=0;
        }

    },

    start () {

    },

    // update (dt) {},
});






























































































