FrontLongJumpBand.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. const PlayerStateStatic = require('PlayerState');
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. },
  6. start () {
  7. },
  8. // onCollisionEnter: function (other) {
  9. // if(other.node.name === 'PlayerCollisionLine')
  10. // {
  11. // var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
  12. // var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState");
  13. // PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.FrontLongJumpBand;
  14. // // cc.log(PlayerStateScript.CurrentInZoneType );
  15. // }
  16. // },
  17. // onCollisionStay: function (other) {
  18. // // console.log('on collision stay');
  19. // },
  20. // onCollisionExit: function (other) {
  21. //
  22. // },
  23. // 只在两个碰撞体开始接触时被调用一次
  24. onBeginContact: function (contact, selfCollider, otherCollider) {
  25. // CustomLog("撞了",otherCollider);
  26. // CustomLog("刚体 棍子限制 碰撞 进入 ,",otherCollider.node.name);
  27. if(otherCollider.node.name === 'Hero')
  28. {
  29. var PlayerStateScript = otherCollider.getComponent("PlayerState");
  30. PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.FrontLongJumpBand;
  31. }
  32. },
  33. // 只在两个碰撞体结束接触时被调用一次
  34. onEndContact: function (contact, selfCollider, otherCollider) {
  35. },
  36. // 每次将要处理碰撞体接触逻辑时被调用
  37. onPreSolve: function (contact, selfCollider, otherCollider) {
  38. },
  39. // 每次处理完碰撞体接触逻辑时被调用
  40. onPostSolve: function (contact, selfCollider, otherCollider) {
  41. },
  42. });