Centralize VideoPanel logic in UIManager to solve reference ambiguity

This commit is contained in:
yangbear
2026-07-10 05:01:29 +08:00
parent 80cb7598e6
commit 0abf59a7d7
3 changed files with 45 additions and 57 deletions
+3 -16
View File
@@ -133,23 +133,10 @@ public class PingClickHandler : MonoBehaviour
}
// 隐藏视频面板
var videoController = FindObjectOfType<VideoController>(true);
if (videoController == null)
var uiMgr = FindObjectOfType<UIManager>();
if (uiMgr != null)
{
var allT = Resources.FindObjectsOfTypeAll<Transform>();
foreach (var t in allT)
{
if (t.name == "VideoPanel" && t.parent != null && t.parent.name == "Canvas")
{
t.gameObject.SetActive(false);
break;
}
}
}
else
{
videoController.StopVideo();
videoController.gameObject.SetActive(false);
uiMgr.HideVideo();
}
}
}