unit85.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { _decorator, Node, tween, UIOpacity } from 'cc';
  2. import { BaseZhaocha } from '../../hall/script/BaseZhaocha';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('unit85')
  5. export class unit85 extends BaseZhaocha {
  6. override answerName: Array<string> = [
  7. "现代灶台",
  8. "水龙头",
  9. "尖叫鸡",
  10. "抽油烟机",
  11. "摄像头",
  12. "冰箱",
  13. "电饭煲",
  14. "温度计",
  15. "调料",
  16. "卫生纸",
  17. "闹钟",
  18. "水果刀",
  19. ]
  20. override num_showTip: number = 2;
  21. override str_tishi = "点击抽油烟机的开关吸走烟雾,露出藏在后面的尖叫鸡。";
  22. @property(Node)
  23. node_zhanai3: Node = null;
  24. @property(Node)
  25. node_zhanai2: Node = null;
  26. @property(Node)
  27. node_zhanai: Node = null;
  28. startPos = null
  29. override start(): void {
  30. super.start()
  31. this.node_zhanai.on(Node.EventType.TOUCH_START, this.touchStart, this)
  32. this.node_zhanai.on(Node.EventType.TOUCH_MOVE, this.touchMove, this)
  33. this.node_zhanai.on(Node.EventType.TOUCH_END, this.touchEnd, this)
  34. this.node_zhanai.on(Node.EventType.TOUCH_CANCEL, this.touchEnd, this)
  35. }
  36. touchStart(e) {
  37. this.node_zhanai3.active = true
  38. tween(this.node_zhanai2.getComponent(UIOpacity))
  39. .to(0.3, { opacity: 0 })
  40. .call(() => {
  41. this.node_zhanai2.active = false
  42. this.arr_node_allitem[2].active = true
  43. })
  44. .start()
  45. }
  46. touchMove() {
  47. }
  48. touchEnd(e) {
  49. }
  50. }