import { UIViewID } from '@scripts/define/UIDefine'; import { UICloseReason } from '@scripts/framework/ui/UILayer'; import { UIView } from '@scripts/framework/ui/UIView'; import { _decorator, Component, Node, Tween, tween } from 'cc'; const { ccclass, property } = _decorator; @ccclass('LoadingView') export class LoadingView extends UIView { readonly viewId = UIViewID.LoadingView; @property(Node) circleNode: Node = null; protected onOpen(_params: unknown): void | Promise { Tween.stopAllByTarget(this.circleNode); tween(this.circleNode).by(0.5, { angle: 50 }).repeatForever().start(); } protected onClose(_reason: UICloseReason): void | Promise { Tween.stopAllByTarget(this.circleNode); } }