
cc.Class({
    extends: cc.Component,

    properties: {
    },

    onCollisionEnter: function (other) {
        console.log("onCollisionEnter jumpBandControl.");
        if (other.node.name === 'PlayerCollisionLine') {
            var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
            var HeroControlScript = PlayerCollisionLine.Hero.getComponent("HeroControl");
            var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState");


            var UIControl = cc.find("UIControl").getComponent("UIControl");
            var Hero = cc.find(other.node.parent.parent.name);
            // cc.log("经过",Hero.name,PlayerStateScript.BTouchedScreenInTheZone_jumpLong);
            if (PlayerStateScript.BTouchedScreenInTheZone_jumpLong){
                // if (this.callbacks != null) {
                //     this.callbacks();
                // }
                    if (Hero.name == "Hero") {
                        UIControl.startDistance_Hero(0, Hero, true);
                        this.seend = HeroControlScript.PlayerStateScript.CurrentSpeed;
                        HeroControlScript.SetCurrentSpeed_max_jumpLong(this.seend);

                        var Hero = cc.find("Hero");
                        var NetworkSocket = Hero.getComponent('NetworkSocket');
                        var data = {};
                        data = {FunctionName:'SetCurrentSpeed_max_jumpLong'};
                        NetworkSocket.sendSyncData(JSON.stringify(data));
                    } else {
                        UIControl.startDistance_Rivel(0, Hero, true);
                    }
            }

        }
    },
    callbacks : function () {

    },
    setCallBackss : function (callback) {
        this.callbacks = callback;
    },


    onCollisionStay: function (other) {
        // console.log('on collision stay');

    },
    onCollisionExit: function (other) {

    }
})
