public void OnGUI()
        {
            if (GUILayout.Button("清空记录"))
            {
                PrefsUtil.DeleteKey(RankMeDialog.RankMeShowKey);
                PrefsUtil.DeleteKey(RankMeDialog.RankMeShowTimeKey);
                PrefsUtil.Flush();
            }

            var shown    = PrefsUtil.GetBool(RankMeDialog.RankMeShowKey, false);
            var newValue = EditorGUILayout.Toggle("已显示", shown);

            if (newValue != shown)
            {
                PrefsUtil.SetBool(RankMeDialog.RankMeShowKey, newValue);
                PrefsUtil.Flush();
            }

            var time = PrefsUtil.GetLong(RankMeDialog.RankMeShowTimeKey, 0);

            EditorGUILayout.LabelField("显示时间: " + time);
            if (GUILayout.Button("设置为当前时间"))
            {
                PrefsUtil.SetLong(RankMeDialog.RankMeShowTimeKey, DateTime.Now.CurrentTimeMillis());
                PrefsUtil.Flush();
            }

            _days = EditorGUILayout.FloatField("天数变化", _days);
            if (GUILayout.Button("设置天数变化"))
            {
                time = PrefsUtil.GetLong(RankMeDialog.RankMeShowTimeKey, 0);
                PrefsUtil.SetLong(RankMeDialog.RankMeShowTimeKey, time + (long)(1000 * 3600 * 24 * _days));
                PrefsUtil.Flush();
            }
        }
Exemple #2
0
        public void OnGUI()
        {
            EditorGUILayout.LabelField("公告栏时间戳", "" + PrefsUtil.GetLong(BillboardPanel.BillboardTimestampKey, 0));
            // EditorGUILayout.LabelField("公告栏已读", PrefsUtil.GetBool(BillboardPanel.BillboardReadFlagKey, false) ? "是" : "否");
            EditorGUILayout.LabelField("公告栏内容:");
            var content = PrefsUtil.GetString(BillboardPanel.BillboardContentKey, null);

            if (!string.IsNullOrEmpty(content))
            {
                EditorGUILayout.LabelField(content);
            }

            if (GUILayout.Button("清空公告板记录"))
            {
                PrefsUtil.DeleteKey(BillboardPanel.BillboardContentKey);
                PrefsUtil.DeleteKey(BillboardPanel.BillboardTimestampKey);
                // PrefsUtil.DeleteKey(BillboardPanel.BillboardReadFlagKey);
                PrefsUtil.Flush();
            }

            if (GUILayout.Button("清空配置"))
            {
                PlayerPrefs.DeleteAll();
                PlayerPrefs.Save();
            }
        }
 public static void SaveAuthCode(string authCode)
 {
     if (string.IsNullOrEmpty(authCode))
     {
         PrefsUtil.DeleteKey(WechatAuthCode);
     }
     else
     {
         PrefsUtil.SetString(WechatAuthCode, authCode);
     }
     PrefsUtil.Flush();
 }
 public static void SaveOpenId(string openId)
 {
     if (string.IsNullOrEmpty(openId))
     {
         PrefsUtil.DeleteKey(WechatOpenId);
     }
     else
     {
         PrefsUtil.SetString(WechatOpenId, openId);
     }
     PrefsUtil.Flush();
 }
        public void OnGUI()
        {
            if (GUILayout.Button("清空登陆类型"))
            {
                PrefsUtil.SetInt(LoginRecord.LoginTypeKey, LoginRecord.NoLogin);
                PrefsUtil.Flush();
            }

            if (GUILayout.Button("清空DeviceId和Username"))
            {
                PrefsUtil.SetString(LoginRecord.VisitorIdKey, "");
                PrefsUtil.SetString(LoginRecord.VisitorUsernameKey, "");
                PrefsUtil.Flush();
            }

            if (GUILayout.Button("清空公告"))
            {
                PrefsUtil.SetString(BillboardPanel.BillboardContentKey, "");
                PrefsUtil.SetLong(BillboardPanel.BillboardTimestampKey, 0);
                PrefsUtil.Flush();
            }

            if (GUILayout.Button("清空选牌类型引导"))
            {
                PrefsUtil.SetBool(PrefsKeys.HasGuideSelectPoker, false);
                PrefsUtil.Flush();
            }

            if (GUILayout.Button(("清空记录选牌的方式")))
            {
                PrefsUtil.DeleteKey(PrefsKeys.XuanDanZhangKey);
                PrefsUtil.DeleteKey(PrefsKeys.HasGuideSelectPoker);
                PrefsUtil.Flush();
            }

            if (GUILayout.Button("清空更新记录"))
            {
                PrefsUtil.DeleteKey(LoginRecord.DontUpdateDateKey);
                PrefsUtil.Flush();
            }

            _content = EditorGUILayout.TextField("版本号", _content);

            if (GUILayout.Button("清空初始化Cache记录"))
            {
                PrefsUtil.SetString("InitAssetKey", _content);;
                var key = PrefsKeys.AssetBundleInitializedKey + _content;
                PrefsUtil.DeleteKey(key);
                PrefsUtil.Flush();
            }

            if (GUILayout.Button("清空所有记录的更新的AssetBundle记录"))
            {
                //路径
                var fullPath = Application.streamingAssetsPath;

                //获取指定路径下面的所有资源文件
                if (Directory.Exists(fullPath))
                {
                    var direction = new DirectoryInfo(fullPath);
                    var files     = direction.GetFiles("*", SearchOption.AllDirectories);

                    Debug.Log(files.Length);

                    for (var i = 0; i < files.Length; i++)
                    {
                        if (files[i].Name.EndsWith(".meta") || files[i].Name.EndsWith(".manifest"))
                        {
                            continue;
                        }

                        PrefsUtil.DeleteKey(files[i].Name);
                        PrefsUtil.Flush();
                        Debug.Log("已清空:" + files[i].Name);
                    }
                }
            }
        }
 public static void RemoveAuthCode()
 {
     PrefsUtil.DeleteKey(WechatAuthCode);
     PrefsUtil.Flush();
 }
 public static void RemoveOpenId()
 {
     PrefsUtil.DeleteKey(WechatOpenId);
     PrefsUtil.Flush();
 }