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.FrontLongAccelerationBand; } }, onCollisionStay: function (other) { }, onCollisionExit: function (other) { if(other.node.name === 'PlayerCollisionLine') { var PlayerCollisionLine = other.getComponent("PlayerCollisionLine"); var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState"); PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.CenterLongAccelerationBand; } } });