import { _decorator, Node, tween, UIOpacity } from 'cc'; import { BaseZhaocha } from '../../hall/script/BaseZhaocha'; const { ccclass, property } = _decorator; @ccclass('unit89') export class unit89 extends BaseZhaocha { override answerName: Array = [ "卫星锅", "避雷针", "充电宝", "单反相机", "螺旋桨", "现代发型", "大金链子", "小黄鸭", "遥控器", "潜水员", "泡面", "条形彩灯", ] override num_showTip: number = 9; 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[9].active = true }) .start() } this.startPos = null } }