EquipOpreate.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { _decorator, Label, Node, tween, UIOpacity } from 'cc';
  2. import { BaseView } from '../../../framework/layer/BaseView';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('EquipOpreate')
  5. export class EquipOpreate extends BaseView {
  6. @property({ type: Label, tooltip: "关闭提示" })
  7. closeTips: Label = null;
  8. @property({ type: Label, tooltip: "标题" })
  9. titieTx: Label = null;
  10. protected onLoad() {
  11. super.onLoad();
  12. this.closeTips.string = StringUtil.getLanguageData('点击空白关闭');
  13. this.titieTx.string = StringUtil.getLanguageData('装备选择');
  14. this.closeTips.node.getComponent(UIOpacity).opacity = 0;
  15. }
  16. protected onDestroy() {
  17. }
  18. //UI开打时会调用,如果有初始化代码应该放到此函数
  19. onOpen() {
  20. tween(this.closeTips.node.getComponent(UIOpacity))
  21. .to(1, { opacity: 255 })
  22. .to(1.2, { opacity: 10 })
  23. .union()
  24. .repeatForever()
  25. .start()
  26. }
  27. //UI关闭时会调用,该函数在onDestroy前调用
  28. onClose() {
  29. }
  30. //框架管理UI层级时会调用,可根据UI情况修改
  31. onShow() {
  32. super.onShow();
  33. }
  34. //框架管理UI层级时会调用,可根据UI情况修改
  35. onHide() {
  36. super.onHide();
  37. }
  38. //UI事件处理
  39. private onTouchButton(event: Event) {
  40. //Framework.audio.playEffect(AudioID.Click);
  41. let target: any = event.target;
  42. }
  43. }