1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- import { _decorator, tween, UIOpacity, Node } from 'cc';
- import { BaseZhaocha } from '../../hall/script/BaseZhaocha';
- const { ccclass, property } = _decorator;
- @ccclass('unit70')
- export class unit70 extends BaseZhaocha {
- override answerName: Array<string> = [
- "台球桌",
- "招牌",
- "红灯笼",
- "黄金球杆",
- "西装",
- "电话手表",
- "凉鞋",
- "比分牌",
- "炸药包",
- "氧气瓶",
- "无影灯",
- "网球",
- ]
- override num_showTip: number = 1;
- override str_tishi = "拖动左上方的卷轴,可展开台球厅招牌";
- @property(Node)
- node_cat: Node = null;
- @property(Node)
- node_juanzhou: Node = null;
- startPos = null
- override start(): void {
- super.start()
- this.node_cat.on(Node.EventType.TOUCH_START, this.touchStart, this)
- this.node_cat.on(Node.EventType.TOUCH_MOVE, this.touchMove, this)
- this.node_cat.on(Node.EventType.TOUCH_END, this.touchEnd, this)
- this.node_cat.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_juanzhou.getComponent(UIOpacity))
- .to(0.5, { opacity: 255 })
- .call(() => {
- this.arr_node_allitem[1].active = true
- })
- .start()
- }
- this.startPos = null
- }
- // OnClickJuanzhou() {
- // tween(this.node_juanzhou.getComponent(UIOpacity))
- // .to(0.5, { opacity: 255 })
- // .call(() => {
- // this.arr_node_allitem[1].active = true
- // })
- // .start()
- // }
- }
|