JavelinStart.js 761 B

12345678910111213141516171819202122232425262728293031
  1. const GameStatesStatic = require('GameStates');
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. },
  6. start () {
  7. },
  8. onCollisionEnter: function (other)
  9. {
  10. // cc.log("可以 ?");
  11. if(other.node.name === 'PlayerCollisionLine')
  12. {
  13. var Level = this.node.parent.parent;
  14. var Canvas = Level.getComponent('LevelControl').Canvas;
  15. var GameStates = Canvas.getComponent('GameStates');
  16. GameStates.CurrentProgress = GameStatesStatic.GameProgress.Javelin;
  17. // cc.log('javalin='+GameStates.CurrentProgress);
  18. }
  19. },
  20. onCollisionStay: function (other) {
  21. // console.log('on collision stay');
  22. },
  23. onCollisionExit: function (other) {
  24. }
  25. });