AccelerationBandCenter.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. const PlayerStateStatic = require('PlayerState');
  2. var BarrierSuperClass = require("BarrierSuper");
  3. cc.Class({
  4. extends:BarrierSuperClass,
  5. properties: {
  6. },
  7. onLoad : function () {
  8. this.node.opacity= 255;
  9. },
  10. onCollisionEnter: function (other) {
  11. // cc.log(other.node.name+'Enter');
  12. if(other.node.name === 'PlayerCollisionLine')
  13. {
  14. var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
  15. var PlayerStateScript = PlayerCollisionLine.node.parent.parent.getComponent("PlayerState");
  16. PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.AccelerationBandCenter;
  17. PlayerStateScript.AccelerationBandCenterTouched = this;
  18. // cc.log(PlayerStateScript.CurrentInZoneType );
  19. }
  20. if(other.node.name === 'LocationLine')
  21. {
  22. this.node.opacity= 0;
  23. // this.node.getComponent(cc.Sprite).destroy();
  24. }
  25. },
  26. onCollisionStay: function (other) {
  27. // console.log('on collision stay');
  28. },
  29. onCollisionExit: function (other) {
  30. },
  31. });