Centralize VideoPanel logic in UIManager to solve reference ambiguity
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user