From 693b915b0ad2a4d4ffda23907fa560a4164127f3 Mon Sep 17 00:00:00 2001 From: wangzhixun <3077614386@qq.com> Date: Tue, 4 Nov 2025 22:02:19 +0800 Subject: [PATCH] 2.0006 --- .../Runtime/Scripts/HighlightEffect.cs | 2 +- .../Scripts/AssetTypes/MediaReference.cs | 6 +-- .../Components/MediaPlayer_AppFocus.cs | 50 ------------------- .../Scripts/Internal/BaseMediaPlayer.cs | 2 +- .../Framework/Manager/TutorialGuideManager.cs | 8 +-- 3d/Assets/Scripts/ExamFileDownloadUI.cs | 32 ++++++------ 3d/Assets/Scripts/TMPInputFieldAutoSetup.cs | 8 +-- 7 files changed, 29 insertions(+), 79 deletions(-) diff --git a/3d/Assets/3rdParty/HighlightPlus/Runtime/Scripts/HighlightEffect.cs b/3d/Assets/3rdParty/HighlightPlus/Runtime/Scripts/HighlightEffect.cs index db218da..a6faf29 100644 --- a/3d/Assets/3rdParty/HighlightPlus/Runtime/Scripts/HighlightEffect.cs +++ b/3d/Assets/3rdParty/HighlightPlus/Runtime/Scripts/HighlightEffect.cs @@ -473,7 +473,7 @@ namespace HighlightPlus { glowPasses[3] = new GlowPassData() { offset = 1, alpha = 0.4f, color = new Color(0.64f, 1f, 0f, 1f) }; } sourceRT = Shader.PropertyToID("_HPSourceRT"); - useGPUInstancing = GPUInstancing && SystemInfo.supportsInstancing; + useGPUInstancing = SystemInfo.supportsInstancing; if (useGPUInstancing) { if (glowPropertyBlock == null) { glowPropertyBlock = new MaterialPropertyBlock(); diff --git a/3d/Assets/AVProVideo/Runtime/Scripts/AssetTypes/MediaReference.cs b/3d/Assets/AVProVideo/Runtime/Scripts/AssetTypes/MediaReference.cs index 4436490..ef9ff19 100644 --- a/3d/Assets/AVProVideo/Runtime/Scripts/AssetTypes/MediaReference.cs +++ b/3d/Assets/AVProVideo/Runtime/Scripts/AssetTypes/MediaReference.cs @@ -76,10 +76,10 @@ namespace RenderHeads.Media.AVProVideo result = GetPlatformMediaReference(Platform.WebGL); #endif - if (result == null) - { + + result = this; - } + return result; } diff --git a/3d/Assets/AVProVideo/Runtime/Scripts/Components/MediaPlayer_AppFocus.cs b/3d/Assets/AVProVideo/Runtime/Scripts/Components/MediaPlayer_AppFocus.cs index 42bb7b3..e8762bd 100644 --- a/3d/Assets/AVProVideo/Runtime/Scripts/Components/MediaPlayer_AppFocus.cs +++ b/3d/Assets/AVProVideo/Runtime/Scripts/Components/MediaPlayer_AppFocus.cs @@ -9,57 +9,7 @@ namespace RenderHeads.Media.AVProVideo { public partial class MediaPlayer : MonoBehaviour { -#region Application Focus and Pausing -#if !UNITY_EDITOR - void OnApplicationFocus(bool focusStatus) - { -#if !(UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN) -// Debug.Log("OnApplicationFocus: focusStatus: " + focusStatus); - if (focusStatus && (isActiveAndEnabled && enabled)) - { - if (Control != null && _wasPlayingOnPause) - { - _wasPlayingOnPause = false; - Control.Play(); - - Helper.LogInfo("OnApplicationFocus: playing video again"); - } - } -#endif - } - - void OnApplicationPause(bool pauseStatus) - { -#if !(UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN) -// Debug.Log("OnApplicationPause: pauseStatus: " + pauseStatus); - - if (pauseStatus) - { - if (_pauseMediaOnAppPause) - { - if (Control!= null && Control.IsPlaying()) - { - _wasPlayingOnPause = true; -#if !UNITY_IPHONE - Control.Pause(); -#endif - Helper.LogInfo("OnApplicationPause: pausing video"); - } - } - } - else - { - if (_playMediaOnAppUnpause) - { - // Catch coming back from power off state when no lock screen - OnApplicationFocus(true); - } - } -#endif - } -#endif -#endregion // Application Focus and Pausing } } #endif diff --git a/3d/Assets/AVProVideo/Runtime/Scripts/Internal/BaseMediaPlayer.cs b/3d/Assets/AVProVideo/Runtime/Scripts/Internal/BaseMediaPlayer.cs index e37a8a4..026e8dd 100644 --- a/3d/Assets/AVProVideo/Runtime/Scripts/Internal/BaseMediaPlayer.cs +++ b/3d/Assets/AVProVideo/Runtime/Scripts/Internal/BaseMediaPlayer.cs @@ -417,7 +417,7 @@ namespace RenderHeads.Media.AVProVideo const float StallDetectionDuration = 0.5f; // Manually detect stalled video if the platform doesn't have native support to detect it - if (SupportsTextureFrameCount() && IsExpectingNewVideoFrame()) + if (IsExpectingNewVideoFrame()) { // Detect a new video frame int frameCount = GetTextureFrameCount(); diff --git a/3d/Assets/Framework/Manager/TutorialGuideManager.cs b/3d/Assets/Framework/Manager/TutorialGuideManager.cs index 9a302e3..bc98c18 100644 --- a/3d/Assets/Framework/Manager/TutorialGuideManager.cs +++ b/3d/Assets/Framework/Manager/TutorialGuideManager.cs @@ -386,16 +386,16 @@ namespace Framework.Manager if (GuideMask.Instance.guide != null) GuideMask.Instance.guide.gameObject.SetActive(true); - bool hasJumpedToGuide = false; + var orderedSteps = guideConfig.GetOrderedSteps(); // 只有在没有跳转到引导步骤的情况下才执行currentIndex++ - if (!hasJumpedToGuide) - { + + currentIndex++; - } + if (currentIndex < orderedSteps.Count) { diff --git a/3d/Assets/Scripts/ExamFileDownloadUI.cs b/3d/Assets/Scripts/ExamFileDownloadUI.cs index 5692f6e..9a5c6ec 100644 --- a/3d/Assets/Scripts/ExamFileDownloadUI.cs +++ b/3d/Assets/Scripts/ExamFileDownloadUI.cs @@ -55,33 +55,33 @@ namespace DefaultNamespace List<(string name, string url)> fileInfos; - if (useGlobalExamName) - { + + // 使用全局题目名字 fileInfos = await FileComponent.GetExamFileInfoWithUrls(); string examName = MotionEngine.GetModule().ExamName; Debug.Log($"使用全局题目名字:{examName}"); - } - else - { - // 使用指定的题目名称 - var examFileInfos = await FileComponent.GetExamFileInfos(examTypeName); - fileInfos = examFileInfos.Select(f => (f.name, f.url)).ToList(); - Debug.Log($"使用指定题目名称:{examTypeName}"); - } + + + + + + + + if (fileInfos.Count == 0) { - string examInfo = useGlobalExamName ? - MotionEngine.GetModule().ExamName : - examTypeName; + string examInfo = MotionEngine.GetModule().ExamName ; + + Debug.LogWarning($"题目 '{examInfo}' 没有配置任何文件"); return; } - string examDisplay = useGlobalExamName ? - MotionEngine.GetModule().ExamName : - examTypeName; + string examDisplay =MotionEngine.GetModule().ExamName ; + + Debug.Log($"为题目 '{examDisplay}' 准备 {fileInfos.Count} 个文件,等待下载完成后显示按钮"); // 不再在初始化时创建按钮,而是等待文件下载完成后创建 diff --git a/3d/Assets/Scripts/TMPInputFieldAutoSetup.cs b/3d/Assets/Scripts/TMPInputFieldAutoSetup.cs index bd37715..792e0c2 100644 --- a/3d/Assets/Scripts/TMPInputFieldAutoSetup.cs +++ b/3d/Assets/Scripts/TMPInputFieldAutoSetup.cs @@ -77,11 +77,11 @@ public class TMPInputFieldAutoSetup : MonoBehaviour // 自动检测组件 AutoDetectComponents(); - // 如果启用自动应用,则应用设置 - if (autoApplyOnAwake) - { + + + ApplySettings(); - } + } ///