RightLongAccelerationBand.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. const PlayerStateStatic = require('PlayerState');
  2. var BarrierSuperClass = require("BarrierSuper");
  3. cc.Class({
  4. extends:BarrierSuperClass,
  5. properties: {
  6. },
  7. start () {
  8. },
  9. onCollisionEnter: function (other) {
  10. // cc.log(other.node.name+'Enter');
  11. if(other.node.name === 'PlayerCollisionLine')
  12. {
  13. // var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
  14. // var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState");
  15. // PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.BehindLongAccelerationBand;
  16. }
  17. },
  18. onCollisionStay: function (other) {
  19. },
  20. onCollisionExit: function (other) {
  21. if(other.node.name === 'PlayerCollisionLine') {
  22. var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
  23. var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState");
  24. if (!PlayerStateScript.BTouchedScreenInTheZone) {
  25. var HeroControlScript = PlayerCollisionLine.Hero.getComponent("HeroControl");
  26. HeroControlScript.Stagger();
  27. }
  28. PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.BehindLongAccelerationBand;
  29. PlayerStateScript.BTouchedScreenInTheZone = false;
  30. }
  31. }
  32. });