예제 #1
0
    // 打开客服界面
    public static void ShowCallCenter()
    {
#if  UNITY_WP8 && !UNITY_EDITOR
        WPSDKHelperScript.Instance().WPReqShowCallCenter();
#elif UNITY_ANDROID && !UNITY_EDITOR
        LoginData.ServerListData lastServerData = LoginData.GetServerListDataByID(PlayerPreferenceData.LastServer);
        LoginData.PlayerRoleData lastRoleData   = LoginData.GetPlayerRoleData(PlayerPreferenceData.LastRoleGUID);
        Obj_MainPlayer           mainPlayer     = Singleton <ObjManager> .GetInstance().MainPlayer;

        if (null != lastServerData && null != lastRoleData && null != mainPlayer)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            JsonWriter writer            = new JsonWriter(sb);
            writer.WriteObjectStart();
            writer.WritePropertyName("serverName");
            writer.Write(lastServerData.m_name);
            writer.WritePropertyName("serverId");
            writer.Write(lastServerData.m_id.ToString());
            writer.WritePropertyName("roleName");
            writer.Write(lastRoleData.name);
            writer.WritePropertyName("roleId");
            writer.Write(string.Format("{0:X16}", lastRoleData.guid));
            writer.WritePropertyName("roleGrade");
            writer.Write(mainPlayer.BaseAttr.Level.ToString());
            writer.WritePropertyName("vipGrade");
            writer.Write(VipData.GetVipLv().ToString());
            writer.WritePropertyName("version");
            writer.Write(GCGame.Utils.GetVersionString());
            writer.WriteObjectEnd();

            AndroidHelper.doSdk("showCallCenter", sb.ToString());
        }
#elif UNITY_IPHONE && !UNITY_EDITOR
        IOSHelper.SDK_ShowCallCenter();
#else
#endif
    }