适配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++)
{
if (string.IsNullOrEmpty(_niuDataArray[i].TaskName)) continue;
if (string.IsNullOrEmpty(_niuDataArray[i].TaskName)|| _niuDataArray[i].ThreeTaskName==ConstCtrl.ThreeTaskName_PeoplePlan) continue;
curstep = _niuDataArray[i];
if (i == _niuDataArray.Count - 1)
{

View File

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

View File

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