using System; using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; using UnityEngine.UI; public class Main : MonoBehaviour { public Button mBtn; private void OnEnable() { mBtn.onClick.AddListener(OnClickBtn); } private void OnDisable() { mBtn.onClick.RemoveAllListeners(); } private void Update() { if (Input.GetKeyDown(KeyCode.LeftArrow)) { CDebug.LogError($"测试记录测试记录测试记录测试记录测试记录测试记录"); } } private void OnClickBtn() { //发文件 StartUpload(); } public async void StartUpload() { // 配置服务参数 (按需修改) //FileUpLoad.UploadEndpoint = "https://api.example.com/upload"; //FileUpLoad.TextCompressionLevel = (System.IO.Compression.CompressionLevel)CompressionLevel.Fastest; // 执行上传 var (success, result) = await FileUpLoad.UploadFileAsync( Path.Combine(LogSystem2025.mLogPath, LogSystem2025.mLogName) ); if (success) { CDebug.Log($"上报成功,感谢您的反馈"); } else { CDebug.LogError($"日志上报失败:{result}"); } } }