import { _decorator, Component, Node, tween, v3, easing, UIOpacity, Tween } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Hello')
export class Hello extends Component {
    @property(Node)
    spineNode:Node = null;
    async onClick1() {
        console.log("on click sign in.");

   
        this.spineNode.active = true;
        tween(this.spineNode).set({scale: v3(0.8,0.8,1)}).to(5, {scale: v3(1, 1, 1.0)}, {easing: easing.backOut}).start();

        let uiOpacity = this.spineNode.getComponent(UIOpacity);
        Tween.stopAllByTarget(uiOpacity);
        uiOpacity.opacity = 0;
        // this.scheduleOnce(()=>{
        //     uiOpacity.opacity = 255
        // },2);
        tween(uiOpacity).to(5, {opacity: 255}).start();
    }

    onClick2() {
        let uiOpacity = this.spineNode.getComponent(UIOpacity);
        Tween.stopAllByTarget(this.spineNode);
        Tween.stopAllByTarget(uiOpacity);
        this.spineNode.active = false;
    
    }
}

