超大量的更新 修复很多问题,gameplay特效初步
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Collections;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
@@ -39,7 +39,7 @@ public class pressStart : MonoBehaviour
|
||||
banflagContent = string.Empty;
|
||||
|
||||
// Ensure status text shows idle
|
||||
UpdateStatus("��ʦ����ר�ã��س�Enter������Ϸ����", Color.green);
|
||||
UpdateStatus("Press Enter to continue.", Color.green);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -48,37 +48,35 @@ public class pressStart : MonoBehaviour
|
||||
|
||||
void Update()
|
||||
{
|
||||
// 增加对任何按键或点击的响应,提高 Build 包的兼容性
|
||||
if (Input.anyKeyDown)
|
||||
if (!(Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)))
|
||||
return;
|
||||
|
||||
bool requestTestMode = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
|
||||
if (requestTestMode)
|
||||
{
|
||||
// 排除掉专门用于测试模式的 Enter 键
|
||||
if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
|
||||
{
|
||||
Debug.Log("[pressStart] Enter detected, starting test mode polling.");
|
||||
GameConfig.testMode = true;
|
||||
if (pollCoroutine != null) StopCoroutine(pollCoroutine);
|
||||
pollCoroutine = StartCoroutine(PollForBanflagAndProceed());
|
||||
return;
|
||||
}
|
||||
|
||||
// 正常流程:点击或空格
|
||||
if (check_enterNextScene)
|
||||
{
|
||||
Debug.Log("[pressStart] Second input detected, loading UI_UI scene. Forcing Time.timeScale = 1.");
|
||||
Time.timeScale = 1f; // Ensure time is running for next scene
|
||||
SceneManager.LoadScene("UI_UI");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log("[pressStart] First input detected, setting check_enterNextScene = true");
|
||||
GameConfig.testMode = false;
|
||||
if (warningText != null)
|
||||
{
|
||||
warningText.gameObject.SetActive(true);
|
||||
warningText.text = WARNING_TEXT_CONTENT;
|
||||
}
|
||||
check_enterNextScene = true;
|
||||
Debug.Log("[pressStart] Enter+Shift detected, starting test mode polling.");
|
||||
GameConfig.testMode = true;
|
||||
if (pollCoroutine != null) StopCoroutine(pollCoroutine);
|
||||
pollCoroutine = StartCoroutine(PollForBanflagAndProceed());
|
||||
return;
|
||||
}
|
||||
|
||||
if (check_enterNextScene)
|
||||
{
|
||||
Debug.Log("[pressStart] Second input detected, loading UI_UI scene. Forcing Time.timeScale = 1.");
|
||||
Time.timeScale = 1f; // Ensure time is running for next scene
|
||||
SceneManager.LoadScene("UI_UI");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log("[pressStart] First input detected, setting check_enterNextScene = true");
|
||||
GameConfig.testMode = false;
|
||||
if (warningText != null)
|
||||
{
|
||||
warningText.gameObject.SetActive(true);
|
||||
warningText.text = WARNING_TEXT_CONTENT;
|
||||
}
|
||||
check_enterNextScene = true;
|
||||
}
|
||||
|
||||
private IEnumerator PollForBanflagAndProceed()
|
||||
@@ -168,7 +166,7 @@ public class pressStart : MonoBehaviour
|
||||
|
||||
if (string.IsNullOrEmpty(banflag_filePath))
|
||||
{
|
||||
Debug.LogWarning("banflag_filePath δ���á�");
|
||||
Debug.LogWarning("banflag_filePath 未设置");
|
||||
UpdateStatus("Error: banflag path not configured", Color.red);
|
||||
return false;
|
||||
}
|
||||
@@ -176,7 +174,7 @@ public class pressStart : MonoBehaviour
|
||||
string filePath = Path.Combine(banflag_filePath, "test.banflag");
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
Debug.LogWarning($"δ�ҵ���Ӧ banflag �ļ�: {filePath}");
|
||||
Debug.LogWarning($"未找到对应 banflag 文件: {filePath}");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -186,11 +184,11 @@ public class pressStart : MonoBehaviour
|
||||
byte[] data = File.ReadAllBytes(filePath);
|
||||
if (data == null || data.Length == 0)
|
||||
{
|
||||
Debug.LogWarning($"banflag �ļ�Ϊ��: {filePath}");
|
||||
Debug.LogWarning($"banflag 文件为空: {filePath}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// ��UTF8��ȡ������Ϊ�����л��ı���
|
||||
// Documentation text normalized.
|
||||
string text = null;
|
||||
try
|
||||
{
|
||||
@@ -204,7 +202,7 @@ public class pressStart : MonoBehaviour
|
||||
bool looksLikeText = false;
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
// �Ƿ�����������ɴ�ӡ�ַ�
|
||||
// Documentation text normalized.
|
||||
int nonPrintable = 0;
|
||||
int checkLen = Mathf.Min(256, text.Length);
|
||||
for (int i = 0; i < checkLen; i++)
|
||||
@@ -217,20 +215,20 @@ public class pressStart : MonoBehaviour
|
||||
|
||||
if (looksLikeText)
|
||||
{
|
||||
Debug.Log($"�ҵ� banflag �ļ�: {filePath}\n����:\n{text}");
|
||||
Debug.Log($"已读取 banflag 文件: {filePath}\n内容:\n{text}");
|
||||
// store the readable content for other scenes
|
||||
banflagContent = text;
|
||||
}
|
||||
else
|
||||
{
|
||||
// ���ǿɶ��ı�תΪbase64
|
||||
// Documentation text normalized.
|
||||
string base64 = System.Convert.ToBase64String(data);
|
||||
Debug.Log($"�ҵ� banflag �ļ� (������): {filePath}������={data.Length} bytes��Base64 ǰ200 �ַ����鿴:\n{(base64.Length > 200 ? base64.Substring(0,200) + "..." : base64)}");
|
||||
Debug.Log($"已读取 banflag 文件(二进制): {filePath},长度={data.Length} bytes,Base64 前200字符预览:\n{(base64.Length > 200 ? base64.Substring(0,200) + "..." : base64)}");
|
||||
banflagContent = $"[Binary Data] Length: {data.Length} bytes";
|
||||
}
|
||||
}
|
||||
|
||||
// ����ͬĿ¼��ָ�������ļ�
|
||||
// Documentation text normalized.
|
||||
string dir = Path.GetDirectoryName(filePath);
|
||||
if (string.IsNullOrEmpty(dir)) dir = banflag_filePath;
|
||||
|
||||
@@ -297,7 +295,7 @@ public class pressStart : MonoBehaviour
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Debug.LogError($"��ȡ banflag �ļ�ʱ����: {ex}");
|
||||
Debug.LogError($"读取 banflag 文件时发生错误: {ex}");
|
||||
UpdateStatus("Error reading banflag", Color.red);
|
||||
// ensure flags cleared on error
|
||||
banflag_exists = false;
|
||||
@@ -308,4 +306,4 @@ public class pressStart : MonoBehaviour
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user