重构插线和深入的逻辑,加入剪线的timeline

This commit is contained in:
2024-12-25 03:48:06 +08:00
parent c3876895d6
commit cc4d3a5a05
26 changed files with 4478 additions and 214 deletions
@@ -1,7 +1,10 @@
using AibisDream.Utility;
using TMPro;
using UnityEngine;
using DG.Tweening;
using Febucci.UI;
using Random = UnityEngine.Random;
using System.Collections;
namespace AibisDream.FixSystem
{
@@ -10,8 +13,8 @@ namespace AibisDream.FixSystem
#region
private BodyModuleSystem _bodyModuleSystem;
private TMP_Text _screenText;
public TMP_Text state; // 显示状态的TextMeshPro组件
private TMP_Text _screenText;// 显示消息的TextMeshPro组件
private WaveformLine _waveformLine;
private ScanLine _scanLine;
private SpriteRenderer _screen;
@@ -44,10 +47,10 @@ namespace AibisDream.FixSystem
_screen = transform.Find("Screen").GetComponent<SpriteRenderer>();
_waveSlider = transform.Find("Wave Slider").GetComponent<WaveSlider>();
_deepinButton = new SpriteButton(transform.Find("Deepin Button").gameObject, false);
_waveformLine.SetLineSize(_screen.bounds.size.x, _screen.bounds.size.y);
_scanLine.SetScreenSize(_screen.bounds.size.x, _screen.bounds.size.y);
_screenText.text = "";
//_screenText.text = "";
MessageBoxSetNull();
_deepinButton.OnButtonDown += HandleDeepInButtonClick;
_scanLine.ScanErrorEvent += OnScanSuccess;
@@ -119,14 +122,15 @@ namespace AibisDream.FixSystem
}
public void HandleDeepInButtonClick()
{
if(_bodyModuleSystem.CableSystem.curBodyModule.data.ignoreWaveCheck==true)
{
_bodyModuleSystem.HandleDeepIn();
}
else
{
StartScan();
}
// if(_bodyModuleSystem.CableSystem.curBodyModule.data.ignoreWaveCheck==true)
// {
// _bodyModuleSystem.HandleDeepIn();
// }
// else
// {
// StartScan();
// }
_bodyModuleSystem.HandleDeepIn();
}
@@ -159,8 +163,62 @@ namespace AibisDream.FixSystem
}
#endregion
}
public void MessageBoxSetError()
{
state.text = "错误";
state.color = Color.red; // 红色
// _screenText.text = message;
// _screenText.color = Color.white; // 默认文本颜色
}
public void MessageBoxSetWarning()
{
state.text = "警告";
state.color = new Color(1.0f, 0.55f, 0.0f); // 琥珀色
// _screenText.text = message;
// _screenText.color = Color.white; // 默认文本颜色
}
public void MessageBoxSetNormal()
{
state.text = "正常";
state.color = Color.blue; // 琥珀色
// _screenText.text = message;
// _screenText.color = Color.white; // 默认文本颜色
}
public void MessageBoxSetChecking()
{
state.text = "检查中";
state.color = Color.white; // 琥珀色
// _screenText.text = string.Empty;
// _screenText.color = Color.white; // 默认文本颜色
}
public void MessageBoxSetText(string text)
{
_screenText.color = Color.white; // 默认文本颜色
_screenText.text += text+"<br>";
}
public void MessageBoxSetNull()
{
state.text = "未检测到信号";
state.color = Color.white; // 蓝色
_screenText.text = string.Empty;
_screenText.color = Color.white; // 默认文本颜色
}
public IEnumerator EnableDeepInButton()
{
yield return _deepinButton.GetTransform().DOLocalMoveX(0.5f, 0.5f).WaitForCompletion();
_deepinButton.SetActive(true);
}
public IEnumerator DisableDeepInButton()
{
yield return _deepinButton.GetTransform().DOLocalMoveX(-0.1f, 0.5f).WaitForCompletion();
_deepinButton.SetActive(false);
}
}
public enum WaveformType
{
Default,