RideBikeEnd.js 531 B

1234567891011121314151617181920
  1. var FinishLine = require("FinishLine");
  2. cc.Class({
  3. extends:FinishLine,
  4. properties: {
  5. },
  6. onCollisionEnter: function (other)
  7. {
  8. this._super(other);
  9. if(other.node.name === 'PlayerCollisionLine')
  10. {
  11. var charactor = cc.find("Hero").getChildByName("Player").getComponent("Charactor");
  12. if (charactor != null) {
  13. charactor.idle();
  14. other.node.parent.parent.getComponent("PlayerState").enableTouch = false;
  15. }
  16. }
  17. },
  18. });