LeftLongAccelerationBand.js 1.0 KB

12345678910111213141516171819202122232425262728293031
  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. if(other.node.name === 'PlayerCollisionLine')
  11. {
  12. var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
  13. var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState");
  14. PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.FrontLongAccelerationBand;
  15. }
  16. },
  17. onCollisionStay: function (other) {
  18. },
  19. onCollisionExit: function (other) {
  20. if(other.node.name === 'PlayerCollisionLine') {
  21. var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
  22. var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState");
  23. PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.CenterLongAccelerationBand;
  24. }
  25. }
  26. });