|
@@ -0,0 +1,82 @@
|
|
|
+import { _decorator, Node, tween, UIOpacity } from 'cc';
|
|
|
+import { BaseZhaocha } from '../../hall/script/BaseZhaocha';
|
|
|
+
|
|
|
+const { ccclass, property } = _decorator;
|
|
|
+
|
|
|
+@ccclass('unit125')
|
|
|
+export class unit125 extends BaseZhaocha {
|
|
|
+ override answerName: Array<string> = [
|
|
|
+ "步枪",
|
|
|
+ "邮票信",
|
|
|
+ "长颈鹿",
|
|
|
+ "口罩",
|
|
|
+ "空罐头",
|
|
|
+ "墨镜",
|
|
|
+ "爱心",
|
|
|
+ "易拉罐",
|
|
|
+ "lv",
|
|
|
+ "瑞士军刀",
|
|
|
+ "闪光弹",
|
|
|
+ "路灯",
|
|
|
+ ]
|
|
|
+
|
|
|
+ // override num_showTip: number = 0;
|
|
|
+ override str_tishi = "滑动右边绿色的布条,露出log";
|
|
|
+
|
|
|
+ @property(Node)
|
|
|
+ node_zhanai: Node = null;
|
|
|
+
|
|
|
+ @property(Node)
|
|
|
+ node_zhanai2: Node = null;
|
|
|
+
|
|
|
+ startPos = null
|
|
|
+
|
|
|
+
|
|
|
+ override start(): void {
|
|
|
+ super.start()
|
|
|
+ this.node_zhanai.on(Node.EventType.TOUCH_START, this.touchStart, this)
|
|
|
+ this.node_zhanai.on(Node.EventType.TOUCH_MOVE, this.touchMove, this)
|
|
|
+ this.node_zhanai.on(Node.EventType.TOUCH_END, this.touchEnd, this)
|
|
|
+ this.node_zhanai.on(Node.EventType.TOUCH_CANCEL, this.touchEnd, this)
|
|
|
+ this.node_zhanai2.on(Node.EventType.TOUCH_START, this.touchStart, this)
|
|
|
+ this.node_zhanai2.on(Node.EventType.TOUCH_MOVE, this.touchMove, this)
|
|
|
+ this.node_zhanai2.on(Node.EventType.TOUCH_END, this.touchEnd2, this)
|
|
|
+ this.node_zhanai2.on(Node.EventType.TOUCH_CANCEL, this.touchEnd2, this)
|
|
|
+ }
|
|
|
+
|
|
|
+ touchStart(e) {
|
|
|
+ this.startPos = e.getUILocation()
|
|
|
+ }
|
|
|
+
|
|
|
+ touchMove() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ touchEnd(e) {
|
|
|
+ let endpos = e.getUILocation()
|
|
|
+ if (this.startPos.subtract(endpos).length() > 100) {
|
|
|
+ tween(this.node_zhanai.getComponent(UIOpacity))
|
|
|
+ .to(0.5, { opacity: 0 })
|
|
|
+ .call(() => {
|
|
|
+ this.node_zhanai.active = false
|
|
|
+ this.arr_node_allitem[1].active = true
|
|
|
+ })
|
|
|
+ .start()
|
|
|
+ }
|
|
|
+
|
|
|
+ this.startPos = null
|
|
|
+ }
|
|
|
+ touchEnd2(e) {
|
|
|
+ let endpos = e.getUILocation()
|
|
|
+ if (this.startPos.subtract(endpos).length() > 100) {
|
|
|
+ tween(this.node_zhanai2.getComponent(UIOpacity))
|
|
|
+ .to(0.5, { opacity: 0 })
|
|
|
+ .call(() => {
|
|
|
+ this.node_zhanai2.active = false
|
|
|
+ this.arr_node_allitem[10].active = true
|
|
|
+ }).start()
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|