| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- const PlayerStateStatic = require('PlayerState');
- var BarrierSuperClass = require("BarrierSuper");
- cc.Class({
- extends:BarrierSuperClass,
- properties: {
- },
- start () {
- },
- onCollisionEnter: function (other) {
- if(other.node.name === 'PlayerCollisionLine')
- {
- var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
- var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState");
- PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.PerfectLongJumpBand;
- PlayerStateScript.PerfectLongJumpBandCenterTouched = this;
- // cc.log(PlayerStateScript.CurrentInZoneType );
- }
- if(other.node.name === 'LocationLine')
- {
- //perfect完美提示
- cc.find('UIControl').getComponent('GameUI').hideTimerPerfect(3);
- cc.find('Hero').getComponent('HeroControl').addPerfectGradeAndPlay();
- this.node.destroy();
- }
- },
- onCollisionStay: function (other) {
- // console.log('on collision stay');
- },
- onCollisionExit: function (other)
- {
- if(other.node.name === 'PlayerCollisionLine') {
- var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
- var HeroControlScript = PlayerCollisionLine.Hero.getComponent("HeroControl");
- var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState");
- if(!PlayerStateScript.BTouchedScreenInTheZone)
- {
- HeroControlScript.Stagger();
- }
- PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.None;
- PlayerStateScript.BTouchedScreenInTheZone = false;
- }
- }
- });
|