12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- "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.onEnable = 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;
- }
- if (this.node.parent.x > 160) {
- this.CliLorR = 1;
- }
- }
- 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;
- }
- if (this.node.parent.x < -160) {
- this.CliLorR = 0;
- }
- }
- };
- NewClass.prototype.onCollisionEnter = function () {
- // if (this.CliLorR === 1) {
- // this.CliLorR = 0;
- // }
- // else {
- // this.CliLorR = 1;
- // }
- return;
- if (this.CliLorR === 0) {
- this.CliLorR = 1;
- Global_1.default.instance.LorR = 1;
- // console.log("这里是CliGD的if"+Global.instance.LorR);
- }
- else {
- this.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();
|