LeftLongAccelerationBand.js 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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. // cc.log("进 长加速带",PlayerStateScript.CurrentInZoneType);
  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. PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.CenterLongAccelerationBand;
  25. // cc.log("出 长加速带",PlayerStateScript.CurrentInZoneType);
  26. }
  27. }
  28. });