Pipeline saving and View popup window added

Made-with: Cursor
This commit is contained in:
Leo Qu
2026-03-10 18:13:32 -04:00
parent 477a86a495
commit 7212f692a6
10 changed files with 5260 additions and 21 deletions

View File

@@ -0,0 +1,50 @@
using UnityEngine;
using UnityEngine.UI;
public class DiscoverOverlayController : MonoBehaviour
{
public GameObject overlayPanel;
public RectTransform overlayContent;
public void ShowOverlay()
{
if (overlayPanel != null)
{
EnsureScrollRect();
overlayPanel.SetActive(true);
}
}
public void HideOverlay()
{
ClearContent();
if (overlayPanel != null)
overlayPanel.SetActive(false);
}
void EnsureScrollRect()
{
if (overlayContent == null) return;
var scrollArea = overlayContent.parent;
if (scrollArea == null) return;
var scrollGo = scrollArea.gameObject;
if (scrollGo.GetComponent<Mask>() == null)
scrollGo.AddComponent<Mask>().showMaskGraphic = false;
var sr = scrollGo.GetComponent<ScrollRect>();
if (sr == null)
{
sr = scrollGo.AddComponent<ScrollRect>();
sr.horizontal = false;
sr.vertical = true;
sr.content = overlayContent;
sr.movementType = ScrollRect.MovementType.Clamped;
}
}
void ClearContent()
{
if (overlayContent == null) return;
for (int i = overlayContent.childCount - 1; i >= 0; i--)
Destroy(overlayContent.GetChild(i).gameObject);
}
}