const PlayerStateStatic = require('PlayerState'); var BarrierSuperClass = require("BarrierSuper"); cc.Class({ extends:BarrierSuperClass, properties: { }, start () { }, onCollisionEnter: function (other) { if(other.node.name === 'PlayerCollisionLine') { cc.find('Hero').getComponent('HeroControl').resetPerfectGrade();//非完美点击,则重置perfectGrade var PlayerCollisionLine = other.getComponent("PlayerCollisionLine"); var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState"); PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.FrontLongJumpBand; // cc.log(PlayerStateScript.CurrentInZoneType ); } }, onCollisionStay: function (other) { // console.log('on collision stay'); }, onCollisionExit: function (other) { } });