end.js 491 B

123456789101112131415161718
  1. var FinishLine = require("FinishLine");
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. },
  6. onCollisionEnter: function (other)
  7. {
  8. if(other.node.name === 'PlayerCollisionLine')
  9. {
  10. var CurrentPlayerNode = other.node.parent.parent;
  11. cc.log("处理啊",other.node.parent.parent.name);
  12. CurrentPlayerNode.stopAllActions();
  13. CurrentPlayerNode.getComponent('HeroControl').SetSpeedToZeroAndIdle();
  14. }
  15. },
  16. });