JavelinEnd.js 931 B

123456789101112131415161718192021222324252627282930313233
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. },
  5. start () {
  6. },
  7. onCollisionEnter: function (other)
  8. {
  9. if(other.node.name === 'PlayerCollisionLine')
  10. {
  11. var Level = this.node.parent.parent;
  12. var Canvas = Level.getComponent('LevelControl').Canvas;
  13. var GameStates = Canvas.getComponent('GameStates');
  14. // other.node.parent.getComponent('HeroControl').ResetSpeed();
  15. var scene = cc.director.getScene();
  16. // cc.log("父亲",scene);
  17. var charactor = scene.getChildByName("Hero").getChildByName("Player").getComponent("Charactor");
  18. charactor.readyRun();
  19. // other.node.parent.getComponent('HeroControl').EnableHeroMoving(false);
  20. }
  21. },
  22. onCollisionStay: function (other) {
  23. // console.log('on collision stay');
  24. },
  25. onCollisionExit: function (other) {
  26. }
  27. });