// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.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

cc.Class({
    extends: cc.Component,

    properties: {
        // foo: {
        //     // ATTRIBUTES:
        //     default: null,        // The default value will be used only when the component attaching
        //                           // to a node for the first time
        //     type: cc.SpriteFrame, // optional, default is typeof default
        //     serializable: true,   // optional, default is true
        // },
        // bar: {
        //     get () {
        //         return this._bar;
        //     },
        //     set (value) {
        //         this._bar = value;
        //     }
        // },
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {
        const currentStage = "NJ_YouLeChang";
        const nextStage = "NJ_Menu";
        const tipsNode = cc.find("tips", this.node)
        window.tipsNode = tipsNode;
        let tipsStage = cc.sys.localStorage.getItem('SYS_GUIDE_TIPS');
        if(!tipsStage) {
            tipsStage = currentStage;
            cc.sys.localStorage.setItem('SYS_GUIDE_TIPS', tipsStage);
        }
        if(tipsStage == currentStage) {
            console.log("显示提示指引 ", currentStage);
            tipsNode.active = true;
        }
        cc.sys.localStorage.setItem('SYS_GUIDE_TIPS', nextStage);
    },

    // update (dt) {},
});
