// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const { ccclass, property } = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {
    private img_1: cc.Node;
    private img_2: cc.Node;
    private count: number;
    onLoad() {
        this.count = 0;
        this.img_1 = this.node.getChildByName('img_1')
        this.img_2 = this.node.getChildByName('img_2')
        this.img_1.active = true;
        this.img_2.active = true;
        cc.tween(this.img_1).repeatForever(
            cc.tween().to(0.25, { opacity: 0 }).to(0.25, { opacity: 255 })
        ).start();
        this.scheduleOnce(() => {
            cc.tween(this.img_2).repeatForever(
                cc.tween().to(0.25, { opacity: 0 }).to(0.25, { opacity: 255 })
            ).start();
        }, 0.1)
    }

    update(dt) {
    }
}
