1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import { _decorator, Node, tween, UIOpacity } from 'cc';
- import { BaseZhaocha } from '../../hall/script/BaseZhaocha';
- const { ccclass, property } = _decorator;
- @ccclass('unit92')
- export class unit92 extends BaseZhaocha {
- override answerName: Array<string> = [
- "英文签名",
- "报警器",
- "长颈鹿",
- "鳄鱼",
- "鲨鱼",
- "椰子",
- "无人机",
- "电灯",
- "手机",
- "牙套",
- "蝴蝶结",
- "调色盘",
- ]
- override num_showTip: number = 10;
- override str_tishi = "移开左侧从上往下数第二个人的帽子,露出里面的蝴蝶结";
- @property(Node)
- node_zhanai: 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)
- }
- 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[10].active = true
- })
- .start()
- }
- this.startPos = null
- }
- }
|