const PlayerStateStatic = require('PlayerState');
var BarrierSuperClass = require("BarrierSuper");
cc.Class({
    extends:BarrierSuperClass,

    properties: {

    },
    start () {

    },
    onCollisionEnter: function (other) {
        // cc.log(other.node.name+'Enter');
        if(other.node.name === 'PlayerCollisionLine')
        {
            // var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
            // var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState");
            // PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.BehindLongAccelerationBand;
        }
    },
    onCollisionStay: function (other) {

    },
    onCollisionExit: function (other) {

        if(other.node.name === 'PlayerCollisionLine') {
            var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
            var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState");
            if (!PlayerStateScript.BTouchedScreenInTheZone) {
                var HeroControlScript = PlayerCollisionLine.Hero.getComponent("HeroControl");
                HeroControlScript.Stagger();
            }
            PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.BehindLongAccelerationBand;
            PlayerStateScript.BTouchedScreenInTheZone = false;
        }
    }
});