技能主要更新,修复卡顿并加入动画,以及各种其他更新。

This commit is contained in:
FloatGaming
2026-02-07 21:05:17 +08:00
parent abeca51be5
commit 1ac3cd0104
1349 changed files with 1526749 additions and 24850 deletions
+55 -33
View File
@@ -39,36 +39,45 @@ public class pressStart : MonoBehaviour
banflagContent = string.Empty;
// Ensure status text shows idle
UpdateStatus("谱师测试专用:回车Enter进入游戏测试版", Color.green);
UpdateStatus("ʦרãسEnterϷ԰", Color.green);
}
// Update is called once per frame
private bool check_enterNextScene = false;
private static readonly string WARNING_TEXT_CONTENT = "<color=orange>当前处于测试阶段</color><color=red>未授权版本</color><color=orange>版本号:</color><color=red>v1.0.0</color><color=orange>,请注意风险。</color>";
void Update()
{
bool check_enterNextScene = false;
if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0))
// 增加对任何按键或点击的响应,提高 Build 包的兼容性
if (Input.anyKeyDown)
{
if (check_enterNextScene) return;
GameConfig.testMode = false;
warningText.text = "<color=orange>你正在尝试进入</color><color=red>未完整开发</color><color=orange>版本,点击</color><color=red>y键</color><color=orange>忽略警告进入。</color>";
check_enterNextScene = true;
}
if (Input.GetKeyDown(KeyCode.Mouse0) && check_enterNextScene)
{
SceneManager.LoadScene("UI_UI");
}
// Enter进入测试模式,不加载json,开始轮询banflag
if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
{
Debug.Log("Entering test mode");
GameConfig.testMode = true;
// start polling for banflag every 3 seconds
if (pollCoroutine != null)
// 排除掉专门用于测试模式的 Enter 键
if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
{
StopCoroutine(pollCoroutine);
Debug.Log("[pressStart] Enter detected, starting test mode polling.");
GameConfig.testMode = true;
if (pollCoroutine != null) StopCoroutine(pollCoroutine);
pollCoroutine = StartCoroutine(PollForBanflagAndProceed());
return;
}
pollCoroutine = StartCoroutine(PollForBanflagAndProceed());
// 正常流程:点击或空格
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;
}
}
@@ -84,7 +93,11 @@ public class pressStart : MonoBehaviour
UpdateStatus("Banflag detected. Loading test mode...", Color.green);
// small delay to show status
yield return new WaitForSeconds(0.5f);
SceneManager.LoadScene(testModeSceneName);
AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(testModeSceneName);
while (!asyncLoad.isDone)
{
yield return null;
}
yield break;
}
else
@@ -96,6 +109,15 @@ public class pressStart : MonoBehaviour
}
}
private IEnumerator LoadSceneAsync(string sceneName)
{
AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(sceneName);
while (!asyncLoad.isDone)
{
yield return null;
}
}
private void UpdateStatus(string message, Color color)
{
if (statusText != null)
@@ -146,7 +168,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;
}
@@ -154,7 +176,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;
}
@@ -164,11 +186,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读取(可能为可序列化文本)
// UTF8ȡΪлı
string text = null;
try
{
@@ -182,7 +204,7 @@ public class pressStart : MonoBehaviour
bool looksLikeText = false;
if (!string.IsNullOrEmpty(text))
{
// 是否包含大量不可打印字符
// Ƿɴӡַ
int nonPrintable = 0;
int checkLen = Mathf.Min(256, text.Length);
for (int i = 0; i < checkLen; i++)
@@ -195,20 +217,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
// ǿɶıתΪbase64
string base64 = System.Convert.ToBase64String(data);
Debug.Log($"找到 banflag 文件 (二进制): {filePath},长度={data.Length} bytesBase64 200 字符供查看:\n{(base64.Length > 200 ? base64.Substring(0,200) + "..." : base64)}");
Debug.Log($"ҵ banflag ļ (): {filePath}={data.Length} bytesBase64 ǰ200 ַ:\n{(base64.Length > 200 ? base64.Substring(0,200) + "..." : base64)}");
banflagContent = $"[Binary Data] Length: {data.Length} bytes";
}
}
// 搜索同目录下指定类型文件
// ͬĿ¼ָļ
string dir = Path.GetDirectoryName(filePath);
if (string.IsNullOrEmpty(dir)) dir = banflag_filePath;
@@ -275,7 +297,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;