コード例 #1
0
 /// <summary>
 /// 刪除沙河目录的数据
 /// </summary>
 public void ClearData()
 {
     PlayerPrefsUtil.DeleteKey(PlayerPrefsKey.IsCopyAssets);
     foreach (var directory in Directory.GetDirectories(Platform.Path))
     {
         Directory.Delete(directory, true);
     }
     foreach (var file in Directory.GetFiles(Platform.Path))
     {
         FileManager.DeleteFile(file);
     }
 }
コード例 #2
0
ファイル: UILoginWindow.cs プロジェクト: liamzhu/LePing
 private void Login_PackModeClick()
 {
     if (ApplicationMgr.Instance.GamePackMode == ApplicationMgr.PackMode.None)
     {
         string data = "{\"country\":\"CN\",\"province\":\"Guangdong\",\"headimgurl\":\"http://wx.qlogo.cn/mmopen/HmVQlX9WkBuWU6xey4ocGHewjEwC7lr3picwqubjzUibZ8PEiaSlqL9yhfm3y17t5BaaJJYaEqDTiapKQkz2h53GmNY3De6kJlAQ/0\",\"unionid\":\"oOvCQwEr1gmzhw3pFAsPbysCEC-A\",\"openid\":\"omFZUwOVvjp4_QznKyFZjW8tvZLo\",\"nickname\":\"take my hand222\\ue110\\ue329\",\"city\":\"Jiangmen\",\"sex\":2,\"language\":\"zh_CN\",\"privilege\":[]}";
         WeChatLoginClick(data);
         //mUIMainModel.SystemInfoReq = SystemInfoReq.Init();
         //mUIMainModel.PlayerInfo = new UserInfo("黑崎一护");
         //Net.Instance.Send((int)ActionType.Regist, OnRegistCallback, null);
     }
     else if (ApplicationMgr.Instance.GamePackMode == ApplicationMgr.PackMode.Random)
     {           //PlayerPrefsUtil.DeleteAll ();
         string passId   = PlayerPrefsUtil.GetString(PassIdKey);
         string nickName = PlayerPrefsUtil.GetString(TempNickNameKey);
         string openID   = PlayerPrefsUtil.GetString(OpenIdKey);
         if (string.IsNullOrEmpty(passId))
         {
             int num = UnityEngine.Random.Range(10, 999);
             mUIMainModel.SystemInfoReq = new SystemInfoReq("kkk200" + num);
             mUIMainModel.PlayerInfo    = new UserInfo("Test" + num);
             Net.Instance.Send((int)ActionType.Regist, OnRegistCallback, null);
         }
         else
         {
             mUIMainModel.PlayerInfo               = new UserInfo(nickName);
             mUIMainModel.SystemInfoReq            = new SystemInfoReq(openID);
             mUIMainModel.SystemInfoReq.PassportID = passId;
             Net.Instance.Send((int)ActionType.Login, OnLoginCallback, null);
         }
     }
     else if (ApplicationMgr.Instance.GamePackMode == ApplicationMgr.PackMode.WeChat)
     {
         if (mSwitchAccount.value)
         {
             PlayerPrefsUtil.DeleteKey(UserInfoKey);
             ApplicationMgr.Instance.ShareSDK.CancelAuthorize(PlatformType.WeChat);
         }
         string data = PlayerPrefsUtil.GetString(UserInfoKey);
         if (data.IsNullOrEmpty())
         {
             ApplicationMgr.Instance.ShareSDK.Authorize(PlatformType.WeChat);
         }
         else
         {
             WeChatLoginClick(data);
         }
     }
 }