FrontAccelerationBand.js 745 B

12345678910111213141516171819202122232425262728
  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,self) {
  10. if(other.node.name === 'PlayerCollisionLine')
  11. {
  12. var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
  13. var PlayerStateScript = PlayerCollisionLine.node.parent.parent.getComponent("PlayerState");
  14. PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.FrontAccelerationBand;
  15. }
  16. },
  17. onCollisionStay: function (other) {
  18. // console.log('on collision stay');
  19. },
  20. onCollisionExit: function (other) {
  21. }
  22. });