const GameStatesStatic = require('GameStates'); cc.Class({ extends: cc.Component, properties: { }, start () { }, onCollisionEnter: function (other) { if(other.node.name === 'PlayerCollisionLine') { var Level = this.node.parent.parent; var Canvas = Level.getComponent('LevelControl').Canvas; var GameStates = Canvas.getComponent('GameStates'); GameStates.CurrentProgress = GameStatesStatic.GameProgress.LongJump; // cc.log('jump='+GameStates.CurrentProgress); } }, onCollisionStay: function (other) { // console.log('on collision stay'); }, onCollisionExit: function (other) { } });