cc.Class({ extends: cc.Component, properties: { }, start () { }, // onCollisionEnter: function (other) // { // if(other.node.name === 'PlayerCollisionLine') // { // var Level = this.node.parent.parent; // var Canvas = Level.getComponent('LevelControl').Canvas; // var GameStates = Canvas.getComponent('GameStates'); // // other.node.parent.parent.getComponent('HeroControl').ResetSpeed(); // } // }, // // onCollisionStay: function (other) { // // console.log('on collision stay'); // }, // onCollisionExit: function (other) { // // }, onBeginContact: function (contact, selfCollider, otherCollider) { // CustomLog("撞了",otherCollider); // CustomLog("刚体 棍子限制 碰撞 进入 ,",otherCollider.node.name); if(otherCollider.node.name === 'Hero') { var Canvas = cc.find("Canvas"); var GameStates = Canvas.getComponent('GameStates'); otherCollider.getComponent('HeroControl').ResetSpeed(); } }, // 只在两个碰撞体结束接触时被调用一次 onEndContact: function (contact, selfCollider, otherCollider) { }, // 每次将要处理碰撞体接触逻辑时被调用 onPreSolve: function (contact, selfCollider, otherCollider) { }, // 每次处理完碰撞体接触逻辑时被调用 onPostSolve: function (contact, selfCollider, otherCollider) { }, });