您现在的位置是:首页 > 前端 > UnityUnity

[Unity 3d] 用户邮件反馈模块

Tdou2020-03-12【Unity】人已围观

简介游戏上线之后因无服务器想接受用户反馈,这时候就需要一键生成基本的设备信息并反馈给我们,此模块自动读取unity相关api 获取设备信息。



using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public static class EmailTool
{
 
    public static void SendEmailCross(string email, string subject = null, string body = null)
    {
        if (string.IsNullOrEmpty(subject))
            subject = EmailSubject();
        if (string.IsNullOrEmpty(body))
            body = EmailBody();
        Func<string, string> EscapeURL = (string url) =>
        {
            return WWW.EscapeURL(url).Replace("+", "%20");
        };

        subject = EscapeURL(subject);
        body = EscapeURL(body);
        Application.OpenURL("mailto:" + email + "?subject=" + subject + "&body=" + body);
    }

    public static string EmailSubject()
    {
        return Application.productName + " V" + Application.version + " " + SystemInfo.deviceModel.ToString();
    }

    public static string EmailBody()
    {
        string info = "\n---Please don't delete the important info below!---";
        info += "\n" + "App version=" + Application.version;
        info += "\n" + "Device type=" + SystemInfo.deviceType.ToString();
        info += "\n" + "Device model=" + SystemInfo.deviceModel.ToString();
        info += "\n" + "Device os=" + SystemInfo.operatingSystem.ToString();
        info += "\n" + "Device id=" + SystemInfo.deviceUniqueIdentifier.ToString();
        info += "\n" + "Screen=" + Screen.width + "*" + Screen.height;
        info += "\n" + "Lauguage=" + Application.systemLanguage;
        return info;
    }
}
 

Tags:Unity   Unity邮件   游戏反馈

很赞哦! ()

  • 微信收款码
  • 支付宝收款码
打赏

文章评论

站点信息

  • 建站时间:2019-12-11
  • 网站程序:帝国CMS7.5
  • 主题模板《今夕何夕》
  • 文章统计52篇文章
  • 标签管理标签云
  • 统计数据百度统计
  • 微信公众号:扫描二维码,关注我们