import { _decorator, Component, Node, sys } from 'cc';
import { config } from './config';
import { settingData } from './data';
const { ccclass, property } = _decorator;

@ccclass('GameManager')
export class GameManager extends Component {
    public static openId:string = 'asd'


    public static getSettingData():settingData {
        let str = sys.localStorage.getItem(config.SETTING_DATA)
        let data = new settingData
        if(str==undefined||str==""||str==null){
            data.isOpenYinYue = true
            data.isOpenYinXiao = true
            data.isOpenZhendong = true
        } else {
            data = JSON.parse(str)
        }
        return data;
    }

    public static saveSettingData(data:settingData) {
        sys.localStorage.setItem(config.SETTING_DATA, JSON.stringify(data));

    }
}


