UI换了很多,spine主视觉停用
This commit is contained in:
@@ -47,7 +47,7 @@ public class pressStart : MonoBehaviour
|
||||
[Header("Start Sequence Settings")]
|
||||
public Volume globalVolume;
|
||||
public Image fadeOutImage;
|
||||
public float startButtonDelay = 6f; // 6秒后才允许点击 Start
|
||||
public float startButtonDelay = 2f; // UI starts showing after 2 seconds; allow clicking then.
|
||||
|
||||
// polling
|
||||
private Coroutine pollCoroutine;
|
||||
@@ -64,7 +64,7 @@ public class pressStart : MonoBehaviour
|
||||
banflagContent = string.Empty;
|
||||
|
||||
// Ensure status text shows idle
|
||||
UpdateStatus("Press Enter to continue.", Color.green);
|
||||
UpdateStatus(LocalizationService.Get("press_start.idle", "Press Enter to continue."), Color.green);
|
||||
|
||||
// Bind buttons
|
||||
if (startButton != null)
|
||||
@@ -130,8 +130,17 @@ public class pressStart : MonoBehaviour
|
||||
// 初始禁用按钮
|
||||
startButton.interactable = false;
|
||||
|
||||
// 等待指定时间 (使用 unscaledTime 以防 timeScale 为 0)
|
||||
yield return new WaitForSecondsRealtime(startButtonDelay);
|
||||
// Keep the click lock aligned with when the main UI starts appearing.
|
||||
float activationDelay = Mathf.Max(0f, startButtonDelay);
|
||||
if (mainCanvasGroup != null)
|
||||
{
|
||||
activationDelay = Mathf.Min(activationDelay, Mathf.Max(0f, fadeDelay));
|
||||
}
|
||||
|
||||
if (activationDelay > 0f)
|
||||
{
|
||||
yield return new WaitForSecondsRealtime(activationDelay);
|
||||
}
|
||||
|
||||
// 启用按钮
|
||||
startButton.interactable = true;
|
||||
@@ -246,7 +255,7 @@ public class pressStart : MonoBehaviour
|
||||
if (warningText != null)
|
||||
{
|
||||
warningText.gameObject.SetActive(true);
|
||||
warningText.text = WARNING_TEXT_CONTENT;
|
||||
warningText.text = LocalizationService.Get("press_start.warning_content", WARNING_TEXT_CONTENT);
|
||||
}
|
||||
|
||||
// 启动进入游戏的异步序列
|
||||
@@ -297,14 +306,14 @@ public class pressStart : MonoBehaviour
|
||||
|
||||
private IEnumerator PollForBanflagAndProceed()
|
||||
{
|
||||
UpdateStatus("Waiting for banflag...", new Color(1f, 0.5f, 0f)); // orange
|
||||
UpdateStatus(LocalizationService.Get("press_start.waiting_banflag", "Waiting for banflag..."), new Color(1f, 0.5f, 0f)); // orange
|
||||
|
||||
while (true)
|
||||
{
|
||||
bool found = check_banflag_testBanflag();
|
||||
if (found)
|
||||
{
|
||||
UpdateStatus("Banflag detected. Loading test mode...", Color.green);
|
||||
UpdateStatus(LocalizationService.Get("press_start.loading_test_mode", "Banflag detected. Loading test mode..."), Color.green);
|
||||
// small delay to show status
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(testModeSceneName);
|
||||
@@ -316,7 +325,7 @@ public class pressStart : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateStatus("Waiting for banflag...", new Color(1f, 0.5f, 0f)); // orange
|
||||
UpdateStatus(LocalizationService.Get("press_start.waiting_banflag", "Waiting for banflag..."), new Color(1f, 0.5f, 0f)); // orange
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(pollInterval);
|
||||
@@ -383,7 +392,7 @@ public class pressStart : MonoBehaviour
|
||||
if (string.IsNullOrEmpty(banflag_filePath))
|
||||
{
|
||||
Debug.LogWarning("banflag_filePath 未设置");
|
||||
UpdateStatus("Error: banflag path not configured", Color.red);
|
||||
UpdateStatus(LocalizationService.Get("press_start.error_path_not_configured", "Error: banflag path not configured"), Color.red);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -505,14 +514,14 @@ public class pressStart : MonoBehaviour
|
||||
Debug.Log($"testmode_audioFile_path = {testmode_audioFile_path}");
|
||||
Debug.Log($"testmode_bgPicFile_path = {testmode_bgPicFile_path}");
|
||||
|
||||
UpdateStatus("Banflag found", Color.green);
|
||||
UpdateStatus(LocalizationService.Get("press_start.banflag_found", "Banflag found"), Color.green);
|
||||
|
||||
return banflag_exists;
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Debug.LogError($"读取 banflag 文件时发生错误: {ex}");
|
||||
UpdateStatus("Error reading banflag", Color.red);
|
||||
UpdateStatus(LocalizationService.Get("press_start.error_reading_banflag", "Error reading banflag"), Color.red);
|
||||
// ensure flags cleared on error
|
||||
banflag_exists = false;
|
||||
testmode_audioFile_path = string.Empty;
|
||||
|
||||
Reference in New Issue
Block a user