EquipOpreate.ts 1.4 KB

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