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

    properties: {
        Barrier: {
            default: null,
            type: cc.Node
        },
        Railing: {
            default: null,
            type: cc.Node
        },
    },

    start () {

    },
    onCollisionEnter: function (other) {
        if(other.node.name === 'PlayerCollisionLine')
        {
            // var PlayerState = other.node.parent.parent.getComponent("PlayerState");
            // PlayerState.TouchControlEnableTouch = true;

            var PlayerCollisionLine = other.getComponent("PlayerCollisionLine");
            var PlayerStateScript = PlayerCollisionLine.Hero.getComponent("PlayerState");
            PlayerStateScript.CurrentInZoneType = PlayerStateStatic.ZoneType.PreHurdleBand;
            // if (other.node.parent.parent.name == "Hero") {
                PlayerStateScript.Barrier = this.Barrier;
            // }
            // if (other.node.parent.parent.name == "Rivel") {
                PlayerStateScript.Railing = this.Railing;
            // }

            // cc.log(PlayerStateScript.CurrentInZoneType );

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

    }
});
