revert(huoshan): 将释放log表现回退至6月版本

保留 Stage6 当前台词,仅恢复粒子与完成表现及 start_expression 参数。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-21 00:03:31 +08:00
co-authored by Cursor
parent 4ec5e0b442
commit 164e3dd50e
5 changed files with 117 additions and 818 deletions
@@ -32,19 +32,6 @@ namespace AibisDream
[Tooltip("噪波故障效果控制器,可选;置于 Expression View 子物体上")]
[SerializeField] private SpriteNoiseGlitchController glitchController;
[Header("常驻细密噪点(不随 glitch 强度消失,营造老屏幕底噪)")]
[Tooltip("常驻噪点密度,0 = 关闭(恢复旧行为:LOG1 无噪点)")]
[SerializeField, Range(0f, 0.3f)] private float ambientNoiseDensity = 0f;
[Tooltip("噪点细密程度,越大颗粒越细(glitch 主噪点默认 80")]
[SerializeField, Range(80f, 800f)] private float ambientNoiseScale = 360f;
[Tooltip("常驻噪点亮度(低于 glitch 主噪点,保持底噪感)")]
[SerializeField, Range(0f, 1f)] private float ambientNoiseBrightness = 0.5f;
// 游玩期干扰联动的 glitch 基线;yarn glitch_transition 调用后暂停联动直到下一轮
private float gameplayGlitchBaseline;
private bool yarnGlitchOverride;
private Coroutine glitchPulseRoutine;
void Start()
{
// 注册到系统字典
@@ -71,24 +58,6 @@ namespace AibisDream
{
glitchController = GetComponentInChildren<SpriteNoiseGlitchController>(true);
}
// 释放log屏幕常驻细密噪点(shader 默认关闭,不影响其他使用该 shader 的场景)
glitchController?.SetAmbientNoise(ambientNoiseDensity, ambientNoiseScale, ambientNoiseBrightness);
}
private void LateUpdate()
{
if (particleManager == null || glitchController == null)
return;
if (particleManager.TryGetFocusedTextBounds(out Bounds textBounds))
{
glitchController.SetCalmField(textBounds);
}
else
{
glitchController.ClearCalmField();
}
}
/// <summary>
@@ -97,8 +66,6 @@ namespace AibisDream
/// </summary>
public void OpenView()
{
glitchController?.ClearCalmField(true);
// 先设置所有初始状态再打开
if (particleManager != null)
{
@@ -118,33 +85,25 @@ namespace AibisDream
/// <param name="targetSentence">目标句子</param>
/// <param name="completionNodeName">完成时触发的对话节点名称(可选)</param>
/// <param name="nonTargetParticleTotal">非目标候选粒子总数;&lt;0 时使用 Inspector 默认候选池大小</param>
/// <param name="interferencePresetIndex">干扰表现档位索引;&lt;0 时使用粒子管理器的全局干扰参数</param>
public void StartSystem(List<string> anxietyPhrases, string targetSentence, string completionNodeName = null, int nonTargetParticleTotal = -1, int interferencePresetIndex = -1)
public void StartSystem(List<string> anxietyPhrases, string targetSentence, string completionNodeName = null, int nonTargetParticleTotal = -1)
{
glitchController?.ClearCalmField(true);
// 新一轮重置干扰联动(解除 yarn 覆盖、基线归零)
yarnGlitchOverride = false;
gameplayGlitchBaseline = 0f;
glitchController?.TransitionTo(0f, 0.25f);
if (particleManager != null)
{
// 使用传入的配置,如果没有则使用默认配置
var phrases = anxietyPhrases ?? defaultAnxietyPhrases;
var sentence = targetSentence ?? defaultTargetSentence;
particleManager.InitializeSystem(phrases, sentence, completionNodeName, nonTargetParticleTotal, interferencePresetIndex);
particleManager.InitializeSystem(phrases, sentence, completionNodeName, nonTargetParticleTotal);
}
}
/// <summary>
/// 启动粒子系统(字符串数组版本,方便 Yarn 调用)
/// </summary>
public void StartSystem(string[] anxietyPhrases, string targetSentence, string completionNodeName = null, int nonTargetParticleTotal = -1, int interferencePresetIndex = -1)
public void StartSystem(string[] anxietyPhrases, string targetSentence, string completionNodeName = null, int nonTargetParticleTotal = -1)
{
List<string> phrasesList = anxietyPhrases != null ? new List<string>(anxietyPhrases) : null;
StartSystem(phrasesList, targetSentence, completionNodeName, nonTargetParticleTotal, interferencePresetIndex);
StartSystem(phrasesList, targetSentence, completionNodeName, nonTargetParticleTotal);
}
/// <summary>
@@ -163,9 +122,6 @@ namespace AibisDream
/// </summary>
public IEnumerator FadeOutParticlesBeforeNewRound(float duration = 0f)
{
glitchController?.ClearCalmField(true);
glitchController?.TransitionTo(0f, 0.25f);
if (particleManager == null) yield break;
yield return StartCoroutine(particleManager.FadeOutBeforeNewExpressionRound(duration));
}
@@ -205,9 +161,6 @@ namespace AibisDream
/// </summary>
public void CloseView()
{
glitchController?.ClearCalmField(true);
glitchController?.TransitionTo(0f, 0f);
if (expressionView != null)
{
expressionView.SetActive(false);
@@ -224,9 +177,6 @@ namespace AibisDream
/// </summary>
public void ResetSystem(bool playEntranceEffect = true)
{
glitchController?.ClearCalmField(true);
glitchController?.TransitionTo(0f, 0.25f);
if (particleManager != null)
{
particleManager.ResetGame(playEntranceEffect);
@@ -258,68 +208,21 @@ namespace AibisDream
spriteRenderer.gameObject.SetActive(false);
}
/// <summary>
/// 游玩期干扰联动:平滑过渡到基线强度。yarn 手动驱动过 glitch 后(override)忽略,
/// 直到下一次 StartSystem 重置。
/// </summary>
public void SetGameplayGlitchBaseline(float target, float smoothDuration = 0.5f)
{
if (glitchController == null || yarnGlitchOverride) return;
gameplayGlitchBaseline = Mathf.Clamp01(target);
if (glitchPulseRoutine != null) return; // 脉冲进行中,结束后会回落到新基线
glitchController.TransitionTo(gameplayGlitchBaseline, smoothDuration);
}
/// <summary>
/// Glitch 短脉冲:快速升到 peak 再回落到游玩基线(用于完成瞬间等强调时刻)。
/// </summary>
public void PlayGlitchPulse(float peak, float duration = 0.5f)
{
if (glitchController == null || yarnGlitchOverride) return;
if (glitchPulseRoutine != null)
{
StopCoroutine(glitchPulseRoutine);
}
glitchPulseRoutine = StartCoroutine(GlitchPulseRoutine(Mathf.Clamp01(peak), duration));
}
private IEnumerator GlitchPulseRoutine(float peak, float duration)
{
yield return glitchController.StartCoroutine(
glitchController.TransitionToAndWait(peak, duration * 0.35f));
yield return glitchController.StartCoroutine(
glitchController.TransitionToAndWait(gameplayGlitchBaseline, duration * 0.65f));
glitchPulseRoutine = null;
}
/// <summary>
/// Glitch 噪波过渡:从当前强度平滑过渡到 to,不瞬移(类似 DOTween)。
/// yarn 手动驱动后,游玩期干扰联动暂停(避免互相打架)。
/// </summary>
public void TransitionGlitch(float to, float duration = 0f)
{
if (glitchController == null) return;
MarkYarnGlitchOverride();
glitchController.TransitionTo(to, duration);
}
private void MarkYarnGlitchOverride()
{
yarnGlitchOverride = true;
if (glitchPulseRoutine != null)
{
StopCoroutine(glitchPulseRoutine);
glitchPulseRoutine = null;
}
}
/// <summary>
/// Glitch 噪波过渡并等待完成:从当前强度平滑过渡到 to。
/// </summary>
public IEnumerator TransitionGlitchAndWait(float to, float duration = 0f)
{
if (glitchController == null) yield break;
MarkYarnGlitchOverride();
yield return glitchController.StartCoroutine(glitchController.TransitionToAndWait(to, duration));
}
@@ -329,9 +232,8 @@ namespace AibisDream
public IEnumerator TransitionGlitchAndWait(float from, float to, float duration)
{
if (glitchController == null) yield break;
MarkYarnGlitchOverride();
yield return glitchController.StartCoroutine(glitchController.TransitionToAndWait(to, duration));
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -19,32 +19,27 @@ namespace AibisDream.MiniGame.Language
/// 注意:Yarn Spinner 2.x 对同名 <see cref="YarnCommand"/> 重载支持不可靠,只保留一个注册入口,用可选参数区分 3/4 参调用。
/// <<start_expression "哈哈|嘿嘿|呵呵" "我很害怕" "ExpressionCompleted">>
/// <<start_expression "哈哈|嘿嘿|呵呵" "我很害怕" "ExpressionCompleted" 24>>
/// <<start_expression "哈哈|嘿嘿|呵呵" "我很害怕" "ExpressionCompleted" 24 1>>
/// (第四项为「非目标」候选粒子总数,候选池 = 目标句字数 + 该值;不写第四项则用 Inspector 的 Candidate Count
/// (第五项为干扰表现档位索引:变字节奏/抖动/glitch联动按档递进,不写则用 Inspector 全局干扰参数)
/// </summary>
/// <param name="anxietyPhrasesStr">干扰短句(笑话等),用 | 分隔,用于非目标粒子字符池,如:"哈哈|嘿嘿|呵呵"</param>
/// <param name="targetSentence">目标句子</param>
/// <param name="completionNode">完成时触发的对话节点(可空字符串)</param>
/// <param name="nonTargetParticleTotal">非目标候选粒子总数;&lt;0 表示使用 Inspector 默认</param>
/// <param name="interferencePresetIndex">干扰表现档位索引;&lt;0 表示使用 Inspector 全局干扰参数</param>
[YarnCommand("start_expression")]
public static IEnumerator StartExpression(
string anxietyPhrasesStr,
string targetSentence,
string completionNode = "",
float nonTargetParticleTotal = -1f,
float interferencePresetIndex = -1f)
float nonTargetParticleTotal = -1f)
{
return RunStartExpression(
anxietyPhrasesStr,
targetSentence,
completionNode ?? "",
UnityEngine.Mathf.RoundToInt(nonTargetParticleTotal),
UnityEngine.Mathf.RoundToInt(interferencePresetIndex));
UnityEngine.Mathf.RoundToInt(nonTargetParticleTotal));
}
private static IEnumerator RunStartExpression(string anxietyPhrasesStr, string targetSentence, string completionNode, int nonTargetParticleTotal, int interferencePresetIndex)
private static IEnumerator RunStartExpression(string anxietyPhrasesStr, string targetSentence, string completionNode, int nonTargetParticleTotal)
{
if (ExpressionManager == null)
{
@@ -65,7 +60,7 @@ namespace AibisDream.MiniGame.Language
// 先淡出上一轮文字/连线等,再淡入火山释放 log,最后开新一轮粒子(避免 log 与旧字叠在一起)
yield return ExpressionManager.FadeOutParticlesBeforeNewRound(0f);
yield return ExpressionManager.EnsureReleaseLogFadedIn(1f);
ExpressionManager.StartSystem(phrases, targetSentence, completionNode, nonTargetParticleTotal, interferencePresetIndex);
ExpressionManager.StartSystem(phrases, targetSentence, completionNode, nonTargetParticleTotal);
yield return ExpressionManager.WaitUntilExpressionFlowReady();
}
@@ -34,15 +34,12 @@
**语法:**
```yarn
<<start_expression "焦虑短句1|焦虑短句2|焦虑短句3" "目标句子" "完成对话节点">>
<<start_expression "焦虑短句1|焦虑短句2" "目标句子" "完成对话节点" 28 1>>
```
**参数说明:**
- **焦虑短句**(必填):多个短句用 `|` 分隔,这些短句会显示在非目标字符上,表示焦虑情绪
- **目标句子**(必填):玩家需要完成的目标句子,系统会根据字数设置目标字符数量
- **完成对话节点**(可选):游戏完成时触发的对话节点名称,不填则不触发
- **非目标粒子总数**(可选,第4参):候选池 = 目标句字数 + 该值;不填用 Inspector 的 Candidate Count
- **干扰表现档位**(可选,第5参):`LanguageParticleManager` Inspector 上 `Interference Presets` 的索引(0/1/2 递进)。只影响非目标粒子的变字节奏、抖动、漂浮、向目标簇的轻微漂移观感和 glitch 联动强度,**不实质增加操作难度**;不填用 Inspector 全局干扰参数
**示例:**
```yarn
+6 -6
View File
@@ -61,11 +61,11 @@ hs: 好…吧…… #line:02115ea
// LOG1: 简单 - 4个目标粒子
// 主题:火山的恐惧
// 干扰词:笑话碎片(短小,2字)
// 难度:简单 - 干扰少,粒子少(非目标 10
// 难度:简单 - 干扰少,粒子少(非目标 16
// ═══════════════════════════════════════════════════════════════
me: 这一条看起来……是一个关于焦虑的记录。 #line:046ab93d
//me: NOTE:或许能找合适的方式让这句话的上下文融进来 #line:05217f0
<<start_expression "哈哈|嘿嘿|呵呵" "我就是个笑话" "LOG1梳理完成" 10>>
<<start_expression "哈哈|嘿嘿|呵呵" "我就是个笑话" "LOG1梳理完成" 16>>
===
title: LOG1梳理完成
@@ -116,11 +116,11 @@ hs: 它们都说我是…… #line:0a8663b
// LOG2: 中等 - 6个目标粒子
// 主题:关于英里的事
// 干扰词:更多笑话碎片(3字)
// 难度:中等 - 干扰略增,表现更躁(非目标 16,表现档1
// 难度:中等 - 干扰增加,粒子增加(非目标 28
// ═══════════════════════════════════════════════════════════════
<<wait 0.3>>
me: 这里又有一条阻塞的log,是关于恐惧的。 #line:03bf85f
<<start_expression "哈哈哈|嘿嘿嘿|呵呵呵|笑死了|好好笑|开玩笑的|别当真嘛|多好笑呀" "不要离开我" "LOG2梳理完成" 16 1>>
<<start_expression "哈哈哈|嘿嘿嘿|呵呵呵|笑死了|好好笑" "不要离开我" "LOG2梳理完成" 28>>
===
title: LOG2梳理完成
@@ -167,11 +167,11 @@ me: 对不起…火山。 #line:03686b2a
// LOG3: 困难 - 8个目标粒子
// 主题:自责与释放
// 干扰词:更多更长的笑话碎片(4-5字),干扰更强
// 难度:困难 - 干扰最多靠表现传达(非目标 22,表现档2
// 难度:困难 - 最多干扰最多粒子(非目标 38
// ═══════════════════════════════════════════════════════════════
<<wait 0.3>>
me: 最后一个log……这是…关于愤怒的。 #line:052abcd
<<start_expression "哈哈哈哈|笑死我了|太好笑了|绷不住了|笑不活了|真的太搞笑|就当玩笑|笑一个嘛|全是段子|我可太逗了" "不要那样看我" "LOG疏通全部完成" 22 2>>
<<start_expression "哈哈哈哈|笑死我了|太好笑了|绷不住了|笑不活了|真的太搞笑" "不要那样看我" "LOG疏通全部完成" 38>>
===
title: LOG疏通全部完成