
                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/CliGD.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '2fd09PdJPRLiqn3k0n9lg6t', 'CliGD');
// Script/CliGD.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var Global_1 = require("./Global");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        /**0 for right */
        _this.CliLorR = 0;
        return _this;
    }
    NewClass.prototype.onLoad = function () {
        if (Math.random() < 0.5) {
            this.CliLorR = 0;
        }
        else {
            this.CliLorR = 1;
        }
    };
    NewClass.prototype.start = function () {
    };
    NewClass.prototype.update = function (dt) {
        if (this.CliLorR == 0) {
            this.node.parent.x++;
            var x = this.node.parent.isHold;
            if (x || this.node.parent.getComponent("GD").isHold) {
                Global_1.default.instance.LorR = 0;
            }
        }
        else {
            this.node.parent.x--;
            var x = this.node.parent.isHold;
            if (x || this.node.parent.getComponent("GD").isHold) {
                Global_1.default.instance.LorR = 1;
            }
        }
    };
    NewClass.prototype.onCollisionEnter = function () {
        var self = this;
        if (self.CliLorR == 0) {
            self.CliLorR = 1;
            Global_1.default.instance.LorR = 1;
            // console.log("这里是CliGD的if"+Global.instance.LorR);
        }
        else {
            self.CliLorR = 0;
            Global_1.default.instance.LorR = 0;
            // console.log("这里是CliGD的else"+Global.instance.LorR);
        }
    };
    __decorate([
        property(Number)
    ], NewClass.prototype, "CliLorR", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxDbGlHRC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxtQ0FBOEI7QUFFeEIsSUFBQSxLQUFzQixFQUFFLENBQUMsVUFBVSxFQUFsQyxPQUFPLGFBQUEsRUFBRSxRQUFRLGNBQWlCLENBQUM7QUFHMUM7SUFBc0MsNEJBQVk7SUFBbEQ7UUFBQSxxRUFpREM7UUFoREcsaUJBQWlCO1FBRWpCLGFBQU8sR0FBVSxDQUFDLENBQUM7O0lBOEN2QixDQUFDO0lBM0NHLHlCQUFNL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cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZXtcclxuICAgICAgICAgICAgdGhpcy5DbGlMb3JSID0gMTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgc3RhcnQgKCkge1xyXG5cclxuICAgIH1cclxuXHJcbiAgICB1cGRhdGUgKGR0KSB7XHJcbiAgICAgICAgaWYodGhpcy5DbGlMb3JSPT0wKXtcclxuICAgICAgICAgICAgdGhpcy5ub2RlLnBhcmVudC54Kys7XHJcbiAgICAgICAgICAgIGxldCB4ID0gdGhpcy5ub2RlLnBhcmVudC5pc0hvbGQ7XHJcbiAgICAgICAgICAgIGlmKHh8fHRoaXMubm9kZS5wYXJlbnQuZ2V0Q29tcG9uZW50KFwiR0RcIikuaXNIb2xkKXtcclxuICAgICAgICAgICAgICAgIEdsb2JhbC5pbnN0YW5jZS5Mb3JSID0gMDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNle1xyXG4gICAgICAgICAgICB0aGlzLm5vZGUucGFyZW50LngtLTtcclxuICAgICAgICAgICAgbGV0IHggPSB0aGlzLm5vZGUucGFyZW50LmlzSG9sZDtcclxuICAgICAgICAgICAgaWYoeHx8dGhpcy5ub2RlLnBhcmVudC5nZXRDb21wb25lbnQoXCJHRFwiKS5pc0hvbGQpe1xyXG4gICAgICAgICAgICAgICAgR2xvYmFsLmluc3RhbmNlLkxvclIgPSAxO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIG9uQ29sbGlzaW9uRW50ZXIoKXtcclxuICAgICAgICBsZXQgc2VsZiA9IHRoaXM7XHJcbiAgICAgICAgaWYoc2VsZi5DbGlMb3JSID09IDApe1xyXG4gICAgICAgICAgICBzZWxmLkNsaUxvclIgPSAxO1xyXG4gICAgICAgICAgICBHbG9iYWwuaW5zdGFuY2UuTG9yUiA9IDE7XHJcbiAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwi6L+Z6YeM5pivQ2xpR0TnmoRpZlwiK0dsb2JhbC5pbnN0YW5jZS5Mb3JSKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZXtcclxuICAgICAgICAgICAgc2VsZi5DbGlMb3JSID0gMDtcclxuICAgICAgICAgICAgR2xvYmFsLmluc3RhbmNlLkxvclIgPSAwO1xyXG4gICAgICAgICAgICAvLyBjb25zb2xlLmxvZyhcIui/memHjOaYr0NsaUdE55qEZWxzZVwiK0dsb2JhbC5pbnN0YW5jZS5Mb3JSKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuIl19