| 12345678910111213141516171819202122232425262728 |
- import { _decorator, Component, Node, Label, tween } from 'cc';
- const { ccclass, property } = _decorator;
- @ccclass('ShowTip')
- export class ShowTip extends Component {
- public static instance: ShowTip = null;
- start() {
- ShowTip.instance = this;
- tween(this.node).hide().start();
- this.node.getComponent(Label).string = '0';
- this.node.setScale(2,2);
- }
- update(deltaTime: number) {
- }
- public Show_Tip(str: string) {
- tween(this.node).show().start();
- this.node.getComponent(Label).string = str;
-
- setTimeout(() => {
- tween(this.node).hide().start();
- }, 1000);
- }
- }
|