适配webgl平台

This commit is contained in:
“CongG” 2025-01-10 09:01:46 +08:00
parent dff3b6fdfe
commit 093120315d
3 changed files with 17 additions and 16 deletions

View File

@ -109,7 +109,7 @@ namespace ZXK.LouDiXvMuNiu
for (int i = 0; i < _niuDataArray.Count; i++) for (int i = 0; i < _niuDataArray.Count; i++)
{ {
if (string.IsNullOrEmpty(_niuDataArray[i].TaskName)) continue; if (string.IsNullOrEmpty(_niuDataArray[i].TaskName)|| _niuDataArray[i].ThreeTaskName==ConstCtrl.ThreeTaskName_PeoplePlan) continue;
curstep = _niuDataArray[i]; curstep = _niuDataArray[i];
if (i == _niuDataArray.Count - 1) if (i == _niuDataArray.Count - 1)
{ {

View File

@ -61,15 +61,8 @@ namespace ZXK.LouDiXvMuNiu
{ {
if (!CheckInfo()) return; if (!CheckInfo()) return;
Queue<string[]> scoreQueue = GameManager.Instance._DataNiuHandler.GetExamScore(); Queue<string[]> scoreQueue = GameManager.Instance._DataNiuHandler.GetExamScore();
#if UNITY_WEBGL #if UNITY_EDITOR || UNITY_STANDALONE
string systemTypeName = GameManager.Instance._CurModelType;
string fileName = "实训成绩单_牛的胚胎移植.pdf";
PDFGreadeManager.Instance.GreatePDFWeb(fileName
, systemTypeName
, scoreQueue
, GameManager.Instance._StudentName
, GameManager.Instance._StudentNumber);
#else
string savePath = CG.UTility.FolderBrowserHelper.GetPathFromWindowsExplorer(); string savePath = CG.UTility.FolderBrowserHelper.GetPathFromWindowsExplorer();
if (!string.IsNullOrEmpty(savePath)) if (!string.IsNullOrEmpty(savePath))
{ {
@ -87,6 +80,14 @@ namespace ZXK.LouDiXvMuNiu
() => { FolderBrowserHelper.OpenFolder(filePath); }); () => { FolderBrowserHelper.OpenFolder(filePath); });
}); });
} }
#elif UNITY_WEBGL
string systemTypeName = GameManager.Instance._CurModelType;
string fileName = "实训成绩单_牛的胚胎移植.pdf";
PDFGreadeManager.Instance.GreatePDFWeb(fileName
, systemTypeName
, scoreQueue
, GameManager.Instance._StudentName
, GameManager.Instance._StudentNumber);
#endif #endif
}); });
ShowScore(GameManager.Instance._DataNiuHandler.GetExamScore()); ShowScore(GameManager.Instance._DataNiuHandler.GetExamScore());

View File

@ -148,10 +148,10 @@ namespace CG.UTility
/// </summary> /// </summary>
/// <param name="dialogtitle">打开对话框的标题</param> /// <param name="dialogtitle">打开对话框的标题</param>
/// <returns>所选文件夹路径</returns> /// <returns>所选文件夹路径</returns>
#if UNITY_WEBGL #if UNITY_EDITOR || UNITY_STANDALONE
private
#else
public public
#elif UNITY_WEBGL
private
#endif #endif
static string GetPathFromWindowsExplorer(string dialogtitle = "请选择下载路径") static string GetPathFromWindowsExplorer(string dialogtitle = "请选择下载路径")
{ {
@ -188,10 +188,10 @@ namespace CG.UTility
/// 打开目录 /// 打开目录
/// </summary> /// </summary>
/// <param name="path">将要打开的文件目录</param> /// <param name="path">将要打开的文件目录</param>
#if UNITY_WEBGL #if UNITY_EDITOR || UNITY_STANDALONE
private
#else
public public
#elif UNITY_WEBGL
private
#endif #endif
static void OpenFolder(string path) static void OpenFolder(string path)
{ {