开头调通
This commit is contained in:
@@ -32,8 +32,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
private CutLine _cutLine;
|
||||
|
||||
[Header("CutText闪烁效果")]
|
||||
private float cutTextFlickerThreshold = 0.7f; // 开始闪烁的阈值
|
||||
[Header("CutText闪烁效果")] private float cutTextFlickerThreshold = 0.7f; // 开始闪烁的阈值
|
||||
private float cutTextFlickerInterval = 0.1f; // 闪烁间隔
|
||||
private float cutTextFlickerTimer = 0f; // 闪烁计时器
|
||||
private bool isCutTextFlickering = false; // 是否正在闪烁
|
||||
@@ -63,7 +62,9 @@ namespace AibisDream.FixSystem
|
||||
_cutSpriteRenderer = transform.Find("Cut Pic")?.GetComponent<SpriteRenderer>();
|
||||
if (_cutSpriteRenderer != null)
|
||||
{
|
||||
_cutTextRenderer = _cutSpriteRenderer.transform.Find("Cut Text")?.GetComponent<SpriteRenderer>(); // 初始化cutText的SpriteRenderer
|
||||
_cutTextRenderer =
|
||||
_cutSpriteRenderer.transform.Find("Cut Text")
|
||||
?.GetComponent<SpriteRenderer>(); // 初始化cutText的SpriteRenderer
|
||||
}
|
||||
|
||||
_highlightMaterial = Resources.Load<Material>("Materials/HighlightMaterial");
|
||||
@@ -142,6 +143,7 @@ namespace AibisDream.FixSystem
|
||||
EnumEventSystem.Global.Send(EventEnum.CutEnd);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
public void SetCutTextVisible(bool visible)
|
||||
{
|
||||
if (_cutTextRenderer != null)
|
||||
@@ -164,6 +166,7 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
StopCoroutine(flickerCoroutine);
|
||||
}
|
||||
|
||||
flickerCoroutine = StartCoroutine(CutTextFlickerCoroutine());
|
||||
}
|
||||
}
|
||||
@@ -176,6 +179,7 @@ namespace AibisDream.FixSystem
|
||||
StopCoroutine(flickerCoroutine);
|
||||
flickerCoroutine = null;
|
||||
}
|
||||
|
||||
// 确保最终状态是可见的
|
||||
SetCutTextVisible(true);
|
||||
}
|
||||
@@ -187,7 +191,7 @@ namespace AibisDream.FixSystem
|
||||
// 随机决定是否显示
|
||||
bool shouldShow = UnityEngine.Random.value > 0.5f;
|
||||
SetCutTextVisible(shouldShow);
|
||||
|
||||
|
||||
// 随机等待时间,模拟接触不良效果
|
||||
float waitTime = UnityEngine.Random.Range(cutTextFlickerInterval * 0.5f, cutTextFlickerInterval * 1.5f);
|
||||
yield return new WaitForSeconds(waitTime);
|
||||
@@ -209,7 +213,7 @@ namespace AibisDream.FixSystem
|
||||
// ShowCutLine();
|
||||
// _cutLine.OnCuttingDown += OnCuttingDown;
|
||||
// _cutting = true;
|
||||
|
||||
|
||||
// EnumEventSystem.Global.Send(EventEnum.CutStart);
|
||||
// }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user