成就系统 巨大修改 新的ui 黑白效果 等一堆

This commit is contained in:
FloatGaming
2026-01-23 18:43:23 +08:00
parent f3ece026ca
commit 0e47864569
256 changed files with 134131 additions and 31192 deletions
+30 -1
View File
@@ -42,6 +42,10 @@ public class WebViewLauncher : MonoBehaviour
public Button forceKillButton; // 强制结束进程按钮
public Button hideWindowButton; // 隐藏webview窗口
public Button showWindowButton; // 显示webview窗口
public Button toggleTextButton; // 新增:控制文本显示/隐藏的按钮
[Header("Text to Toggle")]
public Text controlText; // 要控制显示/隐藏的文本
[Header("Autostart")]
public UnityEngine.UI.Toggle autostartToggle; // UI toggle to control auto-start
@@ -76,6 +80,7 @@ public class WebViewLauncher : MonoBehaviour
if (forceKillButton != null) forceKillButton.onClick.AddListener(OnForceKillClicked);
if (hideWindowButton != null) hideWindowButton.onClick.AddListener(OnHideWindowClicked);
if (showWindowButton != null) showWindowButton.onClick.AddListener(OnShowWindowClicked);
if (toggleTextButton != null) toggleTextButton.onClick.AddListener(ToggleTextVisibility);
if (homepageButton != null) homepageButton.onClick.AddListener(OnHomepageClicked);
if (urlInputField != null) urlInputField.onEndEdit.AddListener(OnUrlInputEndEdit);
@@ -118,6 +123,13 @@ public class WebViewLauncher : MonoBehaviour
Debug.Log("Created H5 folder: " + h5Folder);
}
// Ensure controlText is visible by default
if (controlText != null)
{
controlText.gameObject.SetActive(true);
Debug.Log("Control text set to visible by default");
}
// Prefer explicit openings index as startup page when available
string preferred = Path.Combine(h5Folder, "_officialDocs", "openings", "index.html");
if (File.Exists(preferred))
@@ -170,6 +182,7 @@ public class WebViewLauncher : MonoBehaviour
if (forceKillButton != null) forceKillButton.onClick.RemoveListener(OnForceKillClicked);
if (hideWindowButton != null) hideWindowButton.onClick.RemoveListener(OnHideWindowClicked);
if (showWindowButton != null) showWindowButton.onClick.RemoveListener(OnShowWindowClicked);
if (toggleTextButton != null) toggleTextButton.onClick.RemoveListener(ToggleTextVisibility);
if (autostartToggle != null) autostartToggle.onValueChanged.RemoveListener(OnAutostartToggleChanged);
if (homepageButton != null) homepageButton.onClick.RemoveListener(OnHomepageClicked);
@@ -528,6 +541,22 @@ public class WebViewLauncher : MonoBehaviour
Debug.Log("ShowWindow clicked, result: " + ok);
}
/// <summary>
/// 切换控制文本的显示/隐藏状态
/// </summary>
void ToggleTextVisibility()
{
if (controlText == null)
{
Debug.LogWarning("ToggleTextVisibility: controlText is not assigned");
return;
}
bool isCurrentlyActive = controlText.gameObject.activeSelf;
controlText.gameObject.SetActive(!isCurrentlyActive);
Debug.Log($"Text visibility toggled: {(isCurrentlyActive ? "hidden" : "shown")}");
}
public void StartWebView()
{
LaunchWebView();
@@ -598,7 +627,7 @@ public class WebViewLauncher : MonoBehaviour
string indexPath = Path.Combine(subFolderPath, "index.html");
if (!File.Exists(indexPath))
{
File.WriteAllText(indexPath, "<html><body><h1>" + folderName + "</h1></body></html>");
File.WriteAllText(indexPath, "<html><body><h1>" + folderName + "</h1></html>");
Debug.Log("Created index.html in: " + subFolderPath);
}