import Event = Laya.Event;
export class UserDataInfo
{   

    /******************************************************** */
    
    /**
     * 记录上次离开时间
     */
    static lasttime:string = "lasttime";

    
    static caplastflushtime:string = "captime";
    static capstorageappids:string = "capappids";
    static hasgetappids:string = "hasgetappids";

    /******************************* */
    private onCallLater(): void {
        console.log("onCallLater triggered");

        var text:Laya.Text = new Laya.Text();
        text.font = "SimHei";
        text.fontSize = 30;
        text.color = "#FFFFFF";
        text.text = "打开控制台可见该函数仅触发了一次";
        text.size(Laya.stage.width, Laya.stage.height);
        text.wordWrap = true;
        text.valign = "middle";
        text.align = "center";
        Laya.stage.addChild(text);
    }
    /******************************* */


    /**
     * 角色信息
     */
    static roleData:string = "roleData";
    /********************************************************************** */

    static gold:string = "gold";
    static roleid:string = "roleid";
    static levelid:string = "levelid";

    /**
     * 皮肤
     */
    static skin:string = "skin";

    static lastDay:string = "lastDay";

    static nowdayShare:string = "dayshare";

    static nowdayVideo:string = "dayvideo";

    
/********************************************** */
    private button1:Laya.Sprite;
    private button2:Laya.Sprite;
    private onDecreaseAlpha1(e: Event): void {
        //移除鼠标单击事件
        this.button1.off(Event.CLICK, this, this.onDecreaseAlpha1);
        //定时执行一次(间隔时间)
        Laya.timer.once(3000, this, this.onComplete1);
    }

    private onDecreaseAlpha2(e: Event): void {
        //移除鼠标单击事件
        this.button2.off(Event.CLICK, this, this.onDecreaseAlpha2);
        //定时执行一次(基于帧率)
        Laya.timer.frameOnce(60, this, this.onComplete2);
    }

    private onComplete1(): void {
        //spBtn1的透明度减少0.5
        this.button1.alpha -= 0.5;
    }

    private onComplete2(): void {
        //spBtn2的透明度减少0.5
        this.button2.alpha -= 0.5;
    }
}