ccc 碰撞初步

cc.Class({
    extends: cc.Component,

    properties: {

    },

    // use this for initialization
    onLoad: function () {
        var manager=cc.director.getCollisionManager();
        manager.enabled=true;
        manager.enabledDebugDraw = true;
        manager.enabledDrawBoundingBox = true;
        
    },

    onCollisionEnter: function (other, self) {
        console.log('on collision enter');

    },

    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },
});

原文地址:https://www.cnblogs.com/yufenghou/p/5539208.html