Tips.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { _decorator, Node, tween, Quat, Vec3 } from 'cc';
  2. import { BaseView } from '../../framework/layer/BaseView';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('Tips')
  5. export class Tips extends BaseView {
  6. protected onLoad() {
  7. super.onLoad();
  8. tween(this.node)
  9. .to(0.5,{eulerAngles:new Vec3(this.node.eulerAngles.x,this.node.eulerAngles.y,60),scale:new Vec3(this.node.scale.x-0.2,this.node.scale.y-0.2)})
  10. .to(0.5,{eulerAngles:new Vec3(this.node.eulerAngles.x,this.node.eulerAngles.y,0),scale:new Vec3(this.node.scale.x,this.node.scale.y)})
  11. .union()
  12. .repeatForever()
  13. .start()
  14. }
  15. protected onDestroy() {
  16. }
  17. //UI开打时会调用,如果有初始化代码应该放到此函数
  18. onOpen() {
  19. }
  20. //UI关闭时会调用,该函数在onDestroy前调用
  21. onClose() {
  22. }
  23. //框架管理UI层级时会调用,可根据UI情况修改
  24. onShow() {
  25. super.onShow();
  26. }
  27. //框架管理UI层级时会调用,可根据UI情况修改
  28. onHide() {
  29. super.onHide();
  30. }
  31. //UI事件处理
  32. private onTouchButton(event: Event) {
  33. //Framework.audio.playEffect(AudioID.Click);
  34. let target: any = event.target;
  35. }
  36. }