gameplay所有基本功能都装了,加入了全局警告。加入飘字等各种东西。

This commit is contained in:
FloatGaming
2026-02-21 00:20:03 +08:00
parent 9f7c1c57b7
commit 14fb281d6f
254 changed files with 102927 additions and 9427 deletions
@@ -15,12 +15,38 @@ public static class SkillTriggerFeedUI
private const int MaxEntries = 5;
private static readonly List<string> s_entries = new List<string>(MaxEntries);
// Colors
public static Color CharacterColor = new Color(1f, 0.5f, 0f); // Orange
public static Color SkillColor = Color.cyan; // Cyan/Blue
public static Color MissColor = new Color(1f, 0.27f, 0f); // Orange Red
public static Color DeathColor = Color.black; // Black
public static Color EnemyNameColor = Color.red;
public static Color EnemySpawnColor = Color.yellow;
// Per request: use legacy UI.Text only (not TMP).
private static Text s_feedText;
// Allow manual assignment to bypass GameObject.Find
public static void SetTargetText(Text textComponent)
{
s_feedText = textComponent;
// Automatically enable when a target is set manually
RuntimeEnabled = (textComponent != null);
if (RuntimeEnabled)
{
s_feedText.supportRichText = true;
}
UpdateText();
}
private static int s_boundTextInstanceId;
private static bool s_warnedMissingScore;
private static string ColorToHex(Color color)
{
return ColorUtility.ToHtmlStringRGB(color);
}
public static void Push(string idolName, string skillName)
{
if (!RuntimeEnabled)
@@ -31,11 +57,80 @@ public static class SkillTriggerFeedUI
if (string.IsNullOrWhiteSpace(idolName)) idolName = "Unknown";
if (string.IsNullOrWhiteSpace(skillName)) skillName = "UnknownSkill";
EnsureBound();
if (!HasBoundText()) return;
s_entries.Insert(0, $"{idolName} - {skillName}");
string entry = $"<color=#{ColorToHex(CharacterColor)}>{idolName}</color> - <color=#{ColorToHex(SkillColor)}>{skillName}</color>";
AddEntry(entry);
}
public static void PushMiss(string idolName)
{
if (!RuntimeEnabled)
{
TryHideLegacyFeedRoot();
return;
}
if (string.IsNullOrWhiteSpace(idolName)) idolName = "Unknown";
if (!HasBoundText()) return;
string entry = $"<color=#{ColorToHex(CharacterColor)}>{idolName}</color> - <color=#{ColorToHex(MissColor)}>Miss</color>";
AddEntry(entry);
}
public static void PushDeath(string idolName)
{
if (!RuntimeEnabled)
{
TryHideLegacyFeedRoot();
return;
}
if (string.IsNullOrWhiteSpace(idolName)) idolName = "Unknown";
if (!HasBoundText()) return;
string entry = $"<color=#{ColorToHex(CharacterColor)}>{idolName}</color> - <color=#{ColorToHex(DeathColor)}>死亡</color>";
AddEntry(entry);
}
public static void PushEnemySpawn(string enemyName)
{
if (!RuntimeEnabled)
{
TryHideLegacyFeedRoot();
return;
}
if (string.IsNullOrWhiteSpace(enemyName)) enemyName = "Unknown Enemy";
if (!HasBoundText()) return;
string entry = $"<color=#{ColorToHex(EnemyNameColor)}>{enemyName}</color> - <color=#{ColorToHex(EnemySpawnColor)}>登场</color>";
AddEntry(entry);
}
public static void PushEnemyDeath(string enemyName)
{
if (!RuntimeEnabled)
{
TryHideLegacyFeedRoot();
return;
}
if (string.IsNullOrWhiteSpace(enemyName)) enemyName = "Unknown Enemy";
if (!HasBoundText()) return;
string entry = $"<color=#{ColorToHex(EnemyNameColor)}>{enemyName}</color> - <color=#{ColorToHex(DeathColor)}>死亡</color>";
AddEntry(entry);
}
private static void AddEntry(string formattedEntry)
{
s_entries.Insert(0, formattedEntry);
if (s_entries.Count > MaxEntries)
{
s_entries.RemoveRange(MaxEntries, s_entries.Count - MaxEntries);