const PlayerStateStatic = require('PlayerState'); var BarrierSuperClass = require("BarrierSuper"); cc.Class({ extends: BarrierSuperClass, properties: { }, start () { }, onCollisionEnter: function (other,self) { if(other.node.name === 'PlayerCollisionLine') { var PlayerCollisionLine = other.getComponent("PlayerCollisionLine"); var PlayerStateScript = PlayerCollisionLine.node.parent.parent.getComponent("PlayerState"); PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.FrontAccelerationBand; } }, onCollisionStay: function (other) { // console.log('on collision stay'); }, onCollisionExit: function (other) { } });