提交新的效果
This commit is contained in:
@@ -40,6 +40,18 @@ namespace AibisDream.MiniGame.Language
|
||||
public float dissolveProgress = 0f; // 消散进度(0-1)
|
||||
public WaveformPoint waveformPoint; // 关联的波形点
|
||||
|
||||
// 颜色配置(由Manager设置)
|
||||
private Color targetColor = new Color(1f, 0.39f, 0.39f, 1f); // 目标粒子颜色
|
||||
private Color nonTargetColor = new Color(0.2f, 0.78f, 1f, 1f); // 非目标粒子颜色
|
||||
private Color propagationColor = new Color(1f, 0.59f, 0.2f, 1f); // 传播颜色
|
||||
private Color calmColor = new Color(0.78f, 0.59f, 0.59f, 1f); // 平静后颜色
|
||||
|
||||
// 字体样式配置(由Manager设置)
|
||||
private float targetFontSize = 3.5f;
|
||||
private float nonTargetFontSize = 2.5f;
|
||||
private bool targetBold = true;
|
||||
private bool nonTargetBold = false;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
@@ -47,13 +59,14 @@ namespace AibisDream.MiniGame.Language
|
||||
baseAlpha = 0.6f; // 0-1 范围的透明度
|
||||
probability = Random.Range(0.1f, 1f);
|
||||
alpha = baseAlpha + probability * 0.4f; // 最大 1.0
|
||||
size = 3f;
|
||||
size = nonTargetFontSize; // 默认使用非目标粒子大小
|
||||
velocity = new Vector2(Random.Range(-0.5f, 0.5f), Random.Range(-0.5f, 0.5f));
|
||||
changeInterval = Random.Range(1f, 2.5f);
|
||||
|
||||
if (textMesh != null)
|
||||
{
|
||||
textMesh.fontSize = size;
|
||||
UpdateFontStyle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +138,9 @@ namespace AibisDream.MiniGame.Language
|
||||
{
|
||||
if (textMesh == null) return;
|
||||
|
||||
// 更新字体样式(大小和加粗)
|
||||
UpdateFontStyle();
|
||||
|
||||
// 计算显示位置
|
||||
Vector3 displayOffset = (Vector3)(vibrationOffset + anxietyShakeOffset) + Vector3.up * anxietyFloatY;
|
||||
textMesh.transform.localPosition = displayOffset;
|
||||
@@ -144,19 +160,21 @@ namespace AibisDream.MiniGame.Language
|
||||
|
||||
if (isRed)
|
||||
{
|
||||
// 红色粒子:根据平静进度调整颜色
|
||||
float r = Mathf.Lerp(1f, 0.78f, calmProgress);
|
||||
float g = Mathf.Lerp(0.39f, 0.59f, calmProgress);
|
||||
float b = Mathf.Lerp(0.39f, 0.59f, calmProgress);
|
||||
color = new Color(r, g, b, displayAlpha); // displayAlpha 已经是 0-1 范围
|
||||
// 目标粒子:根据平静进度从目标颜色过渡到平静颜色
|
||||
float r = Mathf.Lerp(targetColor.r, calmColor.r, calmProgress);
|
||||
float g = Mathf.Lerp(targetColor.g, calmColor.g, calmProgress);
|
||||
float b = Mathf.Lerp(targetColor.b, calmColor.b, calmProgress);
|
||||
color = new Color(r, g, b, displayAlpha);
|
||||
}
|
||||
else if (isOrange)
|
||||
{
|
||||
color = new Color(1f, 0.59f, 0.2f, displayAlpha);
|
||||
// 传播效果颜色
|
||||
color = new Color(propagationColor.r, propagationColor.g, propagationColor.b, displayAlpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
color = new Color(0.2f, 0.78f, 1f, displayAlpha);
|
||||
// 非目标粒子颜色
|
||||
color = new Color(nonTargetColor.r, nonTargetColor.g, nonTargetColor.b, displayAlpha);
|
||||
}
|
||||
|
||||
textMesh.color = color;
|
||||
@@ -199,5 +217,53 @@ namespace AibisDream.MiniGame.Language
|
||||
vibrationOffset = Vector2.zero;
|
||||
effectTimer = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置粒子颜色配置
|
||||
/// </summary>
|
||||
public void SetColors(Color target, Color nonTarget, Color propagation, Color calm)
|
||||
{
|
||||
targetColor = target;
|
||||
nonTargetColor = nonTarget;
|
||||
propagationColor = propagation;
|
||||
calmColor = calm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置字体样式配置
|
||||
/// </summary>
|
||||
public void SetFontStyles(float targetSize, float nonTargetSize, bool targetIsBold, bool nonTargetIsBold)
|
||||
{
|
||||
targetFontSize = targetSize;
|
||||
nonTargetFontSize = nonTargetSize;
|
||||
targetBold = targetIsBold;
|
||||
nonTargetBold = nonTargetIsBold;
|
||||
|
||||
// 立即应用
|
||||
if (textMesh != null)
|
||||
{
|
||||
UpdateFontStyle();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新字体样式(根据粒子状态)
|
||||
/// </summary>
|
||||
private void UpdateFontStyle()
|
||||
{
|
||||
if (textMesh == null) return;
|
||||
|
||||
// 根据是否为目标粒子设置大小和加粗
|
||||
if (isRed)
|
||||
{
|
||||
textMesh.fontSize = targetFontSize;
|
||||
textMesh.fontStyle = targetBold ? TMPro.FontStyles.Bold : TMPro.FontStyles.Normal;
|
||||
}
|
||||
else
|
||||
{
|
||||
textMesh.fontSize = nonTargetFontSize;
|
||||
textMesh.fontStyle = nonTargetBold ? TMPro.FontStyles.Bold : TMPro.FontStyles.Normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace AibisDream.MiniGame.Language
|
||||
{
|
||||
/// <summary>
|
||||
/// 连接线渲染器:使用Shapes绘制粒子间的连接线
|
||||
/// 注意:sortingOrder 设置为 0,确保低于文字(文字 sortingOrder = 10)
|
||||
/// </summary>
|
||||
[ExecuteAlways]
|
||||
public class ConnectionRenderer : ImmediateModeShapeDrawer
|
||||
@@ -15,19 +16,33 @@ namespace AibisDream.MiniGame.Language
|
||||
|
||||
[Header("连接线设置")]
|
||||
public float connectionDistance = 2f;
|
||||
public Color blueConnectionColor = new Color(0.39f, 0.78f, 1f, 0.7f);
|
||||
public Color redConnectionColor = new Color(1f, 0.39f, 0.39f, 1f);
|
||||
public float blueLineThickness = 0.02f;
|
||||
public float redLineThickness = 0.04f;
|
||||
private Color nonTargetConnectionColor = new Color(0.39f, 0.78f, 1f, 0.7f); // 非目标粒子连线颜色
|
||||
private Color targetConnectionColor = new Color(1f, 0.39f, 0.39f, 1f); // 目标粒子连线颜色
|
||||
private float nonTargetLineThickness = 0.02f;
|
||||
private float targetLineThickness = 0.04f;
|
||||
|
||||
[Header("效果传播设置")]
|
||||
public Color propagationColor = new Color(1f, 0.59f, 0.2f, 1f);
|
||||
public float propagationLineThickness = 0.03f;
|
||||
private Color propagationColor = new Color(1f, 0.59f, 0.2f, 1f);
|
||||
private float propagationLineThickness = 0.03f;
|
||||
|
||||
private List<CandidateParticle> candidateParticles;
|
||||
private List<EffectPropagation> effectPropagations;
|
||||
private CompletionPhase completionPhase;
|
||||
private float fadeOutAlpha;
|
||||
private float nonTargetAlphaScale = 1f;
|
||||
private float targetAlphaScale = 1f;
|
||||
|
||||
public float NonTargetAlphaScale
|
||||
{
|
||||
get => nonTargetAlphaScale;
|
||||
set => nonTargetAlphaScale = Mathf.Clamp01(value);
|
||||
}
|
||||
|
||||
public float TargetAlphaScale
|
||||
{
|
||||
get => targetAlphaScale;
|
||||
set => targetAlphaScale = Mathf.Clamp(value, 0f, 1.5f);
|
||||
}
|
||||
|
||||
public void SetData(
|
||||
List<CandidateParticle> candidates,
|
||||
@@ -50,15 +65,18 @@ namespace AibisDream.MiniGame.Language
|
||||
{
|
||||
Draw.BlendMode = ShapesBlendMode.Transparent;
|
||||
Draw.ZTest = UnityEngine.Rendering.CompareFunction.Always;
|
||||
// 注意:连接线默认在底层,文字的 sortingOrder = 10 会显示在上层
|
||||
|
||||
// 绘制蓝色粒子间的连线
|
||||
if (completionPhase == CompletionPhase.None || completionPhase == CompletionPhase.Arranging)
|
||||
if (completionPhase == CompletionPhase.None || completionPhase == CompletionPhase.Completed)
|
||||
{
|
||||
DrawBlueConnections();
|
||||
}
|
||||
|
||||
// 绘制红色粒子间的连线
|
||||
if (completionPhase == CompletionPhase.None || completionPhase == CompletionPhase.Arranging)
|
||||
if (completionPhase == CompletionPhase.None ||
|
||||
completionPhase == CompletionPhase.Completed ||
|
||||
completionPhase == CompletionPhase.Focusing)
|
||||
{
|
||||
DrawRedConnections();
|
||||
}
|
||||
@@ -74,7 +92,7 @@ namespace AibisDream.MiniGame.Language
|
||||
private void DrawBlueConnections()
|
||||
{
|
||||
Draw.LineGeometry = LineGeometry.Flat2D;
|
||||
Draw.Thickness = blueLineThickness;
|
||||
Draw.Thickness = nonTargetLineThickness;
|
||||
|
||||
for (int i = 0; i < candidateParticles.Count; i++)
|
||||
{
|
||||
@@ -90,8 +108,8 @@ namespace AibisDream.MiniGame.Language
|
||||
if (distance < connectionDistance)
|
||||
{
|
||||
float alpha = Mathf.Lerp(0.7f, 0f, distance / connectionDistance) * fadeOutAlpha;
|
||||
Color lineColor = blueConnectionColor;
|
||||
lineColor.a = alpha;
|
||||
Color lineColor = nonTargetConnectionColor;
|
||||
lineColor.a = alpha * nonTargetAlphaScale;
|
||||
|
||||
Draw.Line(p1.transform.position, p2.transform.position, lineColor);
|
||||
}
|
||||
@@ -102,7 +120,7 @@ namespace AibisDream.MiniGame.Language
|
||||
private void DrawRedConnections()
|
||||
{
|
||||
Draw.LineGeometry = LineGeometry.Flat2D;
|
||||
Draw.Thickness = redLineThickness;
|
||||
Draw.Thickness = targetLineThickness;
|
||||
|
||||
var redParticles = new List<CandidateParticle>();
|
||||
foreach (var p in candidateParticles)
|
||||
@@ -123,8 +141,8 @@ namespace AibisDream.MiniGame.Language
|
||||
if (distance < connectionDistance)
|
||||
{
|
||||
float alpha = Mathf.Lerp(1f, 0.4f, distance / connectionDistance);
|
||||
Color lineColor = redConnectionColor;
|
||||
lineColor.a = alpha;
|
||||
Color lineColor = targetConnectionColor;
|
||||
lineColor.a = alpha * targetAlphaScale;
|
||||
|
||||
Draw.Line(redParticles[i].transform.position, redParticles[j].transform.position, lineColor);
|
||||
}
|
||||
@@ -205,6 +223,25 @@ namespace AibisDream.MiniGame.Language
|
||||
|
||||
Draw.Triangle(tip, left, right, color);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置连接线样式
|
||||
/// </summary>
|
||||
public void SetConnectionStyles(
|
||||
Color targetColor,
|
||||
Color nonTargetColor,
|
||||
Color propColor,
|
||||
float targetThickness,
|
||||
float nonTargetThickness,
|
||||
float propThickness)
|
||||
{
|
||||
targetConnectionColor = targetColor;
|
||||
nonTargetConnectionColor = nonTargetColor;
|
||||
propagationColor = propColor;
|
||||
targetLineThickness = targetThickness;
|
||||
nonTargetLineThickness = nonTargetThickness;
|
||||
propagationLineThickness = propThickness;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,42 +23,46 @@ namespace AibisDream.MiniGame.Language
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 效果传播系统:管理从红色粒子到蓝色粒子的效果传递
|
||||
/// 效果传播系统:管理从红色粒子到蓝色粒子的效果传递(使用BFS算法)
|
||||
/// </summary>
|
||||
public class EffectPropagation
|
||||
{
|
||||
private CandidateParticle redParticle;
|
||||
private List<PropagationInfo> propagatedParticles = new List<PropagationInfo>();
|
||||
private List<CandidateParticle> propagationQueue = new List<CandidateParticle>();
|
||||
private Queue<CandidateParticle> propagationQueue = new Queue<CandidateParticle>();
|
||||
|
||||
private float lifeTimer;
|
||||
private float propagationDelay = 0.05f;
|
||||
private float propagationDelay;
|
||||
private float propagationCounter = 0f;
|
||||
private int maxPropagationSteps = 8;
|
||||
private int currentPropagationStep = 0;
|
||||
private int maxPropagationNodes;
|
||||
private int currentNodeCount = 0;
|
||||
private int currentStep = 0;
|
||||
|
||||
public bool IsActive => lifeTimer > 0;
|
||||
public List<PropagationInfo> PropagatedParticles => propagatedParticles;
|
||||
|
||||
public EffectPropagation(CandidateParticle redParticle, float duration = 1f)
|
||||
public EffectPropagation(CandidateParticle redParticle, float duration, float delay, int maxNodes)
|
||||
{
|
||||
this.redParticle = redParticle;
|
||||
this.lifeTimer = duration;
|
||||
this.propagationDelay = delay;
|
||||
this.maxPropagationNodes = maxNodes;
|
||||
|
||||
// 从红色粒子开始传播
|
||||
// 从红色粒子开始传播(第0步)
|
||||
var connectedBlues = FindConnectedBlues(redParticle);
|
||||
if (connectedBlues.Count > 0 && currentPropagationStep < maxPropagationSteps)
|
||||
if (connectedBlues.Count > 0 && currentNodeCount < maxPropagationNodes)
|
||||
{
|
||||
// 随机选择一个连接的蓝色粒子
|
||||
var targetParticle = connectedBlues[Random.Range(0, connectedBlues.Count)];
|
||||
ApplyEffectToParticle(targetParticle);
|
||||
// 第一步:处理所有直接连接的蓝色粒子(BFS第一层)
|
||||
foreach (var targetParticle in connectedBlues)
|
||||
{
|
||||
if (currentNodeCount >= maxPropagationNodes) break;
|
||||
|
||||
// 记录传播信息
|
||||
propagatedParticles.Add(new PropagationInfo(targetParticle, redParticle, 1));
|
||||
|
||||
// 加入传播队列
|
||||
propagationQueue.Add(targetParticle);
|
||||
currentPropagationStep = 1;
|
||||
ApplyEffectToParticle(targetParticle);
|
||||
propagatedParticles.Add(new PropagationInfo(targetParticle, redParticle, 1));
|
||||
propagationQueue.Enqueue(targetParticle);
|
||||
currentNodeCount++;
|
||||
}
|
||||
currentStep = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,35 +71,33 @@ namespace AibisDream.MiniGame.Language
|
||||
lifeTimer -= deltaTime;
|
||||
propagationCounter += deltaTime;
|
||||
|
||||
// 定期传播
|
||||
if (propagationCounter >= propagationDelay && currentPropagationStep < maxPropagationSteps)
|
||||
// BFS逐层传播
|
||||
if (propagationCounter >= propagationDelay && propagationQueue.Count > 0 && currentNodeCount < maxPropagationNodes)
|
||||
{
|
||||
propagationCounter = 0f;
|
||||
currentStep++;
|
||||
|
||||
List<CandidateParticle> nextQueue = new List<CandidateParticle>();
|
||||
|
||||
foreach (var sourceParticle in propagationQueue)
|
||||
// 处理当前层的所有节点
|
||||
int currentLevelSize = propagationQueue.Count;
|
||||
|
||||
for (int i = 0; i < currentLevelSize; i++)
|
||||
{
|
||||
if (currentPropagationStep >= maxPropagationSteps) break;
|
||||
|
||||
if (currentNodeCount >= maxPropagationNodes) break;
|
||||
|
||||
var sourceParticle = propagationQueue.Dequeue();
|
||||
var connectedBlues = FindConnectedBlues(sourceParticle);
|
||||
if (connectedBlues.Count > 0)
|
||||
|
||||
// 将所有连接的蓝色粒子加入下一层
|
||||
foreach (var targetParticle in connectedBlues)
|
||||
{
|
||||
var targetParticle = connectedBlues[Random.Range(0, connectedBlues.Count)];
|
||||
if (currentNodeCount >= maxPropagationNodes) break;
|
||||
|
||||
ApplyEffectToParticle(targetParticle);
|
||||
|
||||
currentPropagationStep++;
|
||||
|
||||
propagatedParticles.Add(new PropagationInfo(targetParticle, sourceParticle, currentPropagationStep));
|
||||
|
||||
if (currentPropagationStep < maxPropagationSteps)
|
||||
{
|
||||
nextQueue.Add(targetParticle);
|
||||
}
|
||||
propagatedParticles.Add(new PropagationInfo(targetParticle, sourceParticle, currentStep + 1));
|
||||
propagationQueue.Enqueue(targetParticle);
|
||||
currentNodeCount++;
|
||||
}
|
||||
}
|
||||
|
||||
propagationQueue = nextQueue;
|
||||
}
|
||||
|
||||
// 更新所有传播粒子的脉冲动画
|
||||
|
||||
@@ -7,6 +7,8 @@ namespace AibisDream.MiniGame.Language
|
||||
/// </summary>
|
||||
public class FloatingTextParticle : TextParticle
|
||||
{
|
||||
private Color baseColor = new Color(0.7f, 0.78f, 1f, 1f); // 默认颜色
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
@@ -15,13 +17,37 @@ namespace AibisDream.MiniGame.Language
|
||||
baseAlpha = Random.Range(0.04f, 0.1f); // 0-1 范围的透明度
|
||||
alpha = baseAlpha;
|
||||
size = Random.Range(1.5f, 2.5f);
|
||||
velocity = new Vector2(Random.Range(-0.3f, 0.3f), Random.Range(-0.3f, 0.3f));
|
||||
changeInterval = Random.Range(0.5f, 0.7f);
|
||||
velocity = new Vector2(Random.Range(-1.2f, 1.2f), Random.Range(-1.2f, 1.2f));
|
||||
changeInterval = Random.Range(0.2f, 0.3f);
|
||||
|
||||
if (textMesh != null)
|
||||
{
|
||||
textMesh.fontSize = size;
|
||||
textMesh.color = new Color(0.7f, 0.78f, 1f, alpha);
|
||||
textMesh.color = new Color(baseColor.r, baseColor.g, baseColor.b, alpha);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置粒子颜色
|
||||
/// </summary>
|
||||
public void SetColor(Color color)
|
||||
{
|
||||
baseColor = color;
|
||||
if (textMesh != null)
|
||||
{
|
||||
textMesh.color = new Color(baseColor.r, baseColor.g, baseColor.b, alpha);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置字体大小
|
||||
/// </summary>
|
||||
public void SetFontSize(float fontSize)
|
||||
{
|
||||
size = fontSize;
|
||||
if (textMesh != null)
|
||||
{
|
||||
textMesh.fontSize = size;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +55,13 @@ namespace AibisDream.MiniGame.Language
|
||||
{
|
||||
if (textMesh != null)
|
||||
{
|
||||
Color color = new Color(0.7f, 0.78f, 1f, alpha);
|
||||
Color color = new Color(baseColor.r, baseColor.g, baseColor.b, alpha);
|
||||
textMesh.color = color;
|
||||
}
|
||||
|
||||
if (glowSprite != null)
|
||||
{
|
||||
glowSprite.color = new Color(0.7f, 0.78f, 1f, alpha * 0.3f);
|
||||
glowSprite.color = new Color(baseColor.r, baseColor.g, baseColor.b, alpha * 0.3f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -38,61 +38,6 @@
|
||||
### 6. 游戏目标与完成序列
|
||||
**目标**:让所有红色粒子连接成一个整体,且与蓝色粒子分离
|
||||
|
||||
**完成序列**:
|
||||
1. **arranging阶段**:
|
||||
- 红色粒子排列成水平一行(屏幕中央)
|
||||
- 蓝色/橙色粒子停止移动
|
||||
- 非红色粒子淡出
|
||||
|
||||
2. **revealing阶段**:
|
||||
- 红色粒子逐个显示目标文字:"别过来我感觉害怕"
|
||||
- 显示前快速闪烁随机字符
|
||||
- 文字开始剧烈抖动(焦虑效果)
|
||||
|
||||
3. **completed阶段**:
|
||||
- 进入波形交互阶段
|
||||
|
||||
### 7. 波形交互系统(核心创新)
|
||||
**初始状态**:
|
||||
- 每个文字下方有一个对应的波形点
|
||||
- 波形使用Perlin噪声生成(多层噪声叠加)
|
||||
- 波形呈现异常、混乱的抖动
|
||||
- 文字随波形剧烈抖动+上下漂浮(表现焦虑情绪)
|
||||
|
||||
**交互机制**:
|
||||
- 玩家按住鼠标左键并拖动,抚平附近的波形
|
||||
- 波形有"抵抗力"机制:
|
||||
- 异常程度越高,抵抗力越强
|
||||
- 需要持续按住30-90帧才能完全抚平
|
||||
- 拖动速度越快,抚平效果越强
|
||||
- 抚平区域有交互半径(50像素)
|
||||
- 显示进度环反馈
|
||||
|
||||
**抚平效果**:
|
||||
- 波形从异常噪波逐渐变为规律的正弦波
|
||||
- 波形颜色从红色渐变为蓝色
|
||||
- 对应文字的抖动和漂浮逐渐减弱
|
||||
- 波形完全抚平后:
|
||||
- 文字停止变化和抖动
|
||||
- 文字开始消散(透明度降低)
|
||||
- 波形点也随之消散
|
||||
|
||||
**视觉反馈**:
|
||||
- 抚平时产生蓝色粒子效果
|
||||
- 鼠标周围显示交互范围圈
|
||||
- 波形点显示抚平进度环
|
||||
- 底部显示整体平静进度条
|
||||
|
||||
**情感隐喻**:
|
||||
- 异常波形 = 焦虑、不安的情绪
|
||||
- 文字抖动 = 情绪的外在表现
|
||||
- 抚平波形 = 安抚、平复情绪的过程
|
||||
- 文字消散 = 负面情绪的消解
|
||||
|
||||
### 8. 重置机制
|
||||
- 所有文字消散后,游戏自动重置
|
||||
- 粒子重新随机分布
|
||||
- 重新选择8个红色目标粒子
|
||||
|
||||
## Unity实现要点
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: aff5f43b9eb5c4242842ca3cc33afd99, type: 3}
|
||||
m_Name: NeuralPropagationConfig
|
||||
m_EditorClassIdentifier:
|
||||
bluePropagations:
|
||||
- startChar: "\u6628"
|
||||
content: "\u6628\u5929\u6211\u78B0"
|
||||
- startChar: "\u6211"
|
||||
content: "\u544A\u8BC9\u6211"
|
||||
anxietyWords:
|
||||
- "\u5BB3\u6015"
|
||||
- "\u600E\u4E48\u529E"
|
||||
- "\u56DE\u907F"
|
||||
- "\u7D27\u5F20"
|
||||
- "\u7126\u8651"
|
||||
- "\u62C5\u5FC3"
|
||||
- "\u6050\u60E7"
|
||||
- "\u4E0D\u5B89"
|
||||
hiddenInfo: "\u82F1\u91CC"
|
||||
bluePropagationSpeed: 1
|
||||
redOverrideInterval: 2
|
||||
propagationDistance: 2
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3896a6c1f7dac79448309febc22689de
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -161,6 +161,32 @@ namespace AibisDream.MiniGame.Language
|
||||
textMesh.text = currentChar;
|
||||
}
|
||||
|
||||
public void ForceSetCharacter(string character)
|
||||
{
|
||||
currentChar = character;
|
||||
UpdateText();
|
||||
}
|
||||
|
||||
public void SetStaticState(bool value)
|
||||
{
|
||||
isStatic = value;
|
||||
}
|
||||
|
||||
public void SetCalmedState(bool value)
|
||||
{
|
||||
isCalmed = value;
|
||||
}
|
||||
|
||||
public void SetChangeInterval(float interval)
|
||||
{
|
||||
changeInterval = Mathf.Max(0.02f, interval);
|
||||
}
|
||||
|
||||
public void ResetChangeTimer(float timer)
|
||||
{
|
||||
changeTimer = timer;
|
||||
}
|
||||
|
||||
protected virtual void UpdateVisuals()
|
||||
{
|
||||
if (textMesh != null)
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace AibisDream.MiniGame.Language
|
||||
{
|
||||
/// <summary>
|
||||
/// 波形渲染器:使用Shapes绘制波形和交互效果
|
||||
/// 注意:渲染在底层,确保低于文字(文字 sortingOrder = 10)
|
||||
/// </summary>
|
||||
[ExecuteAlways]
|
||||
public class WaveformRenderer : ImmediateModeShapeDrawer
|
||||
@@ -83,13 +84,14 @@ namespace AibisDream.MiniGame.Language
|
||||
if (waveformPoints == null || waveformPoints.Count == 0)
|
||||
return;
|
||||
|
||||
if (completionPhase != CompletionPhase.Revealing && completionPhase != CompletionPhase.Completed)
|
||||
if (completionPhase != CompletionPhase.Focusing)
|
||||
return;
|
||||
|
||||
using (Draw.Command(cam))
|
||||
{
|
||||
Draw.BlendMode = ShapesBlendMode.Transparent;
|
||||
Draw.ZTest = UnityEngine.Rendering.CompareFunction.Always;
|
||||
// 注意:波形默认在底层,文字的 sortingOrder = 10 会显示在上层
|
||||
|
||||
// 绘制粒子效果
|
||||
DrawWaveformParticles();
|
||||
|
||||
Reference in New Issue
Block a user