重构暂存
This commit is contained in:
@@ -20,7 +20,7 @@ public class ToolManager : MonoBehaviour
|
||||
public bool HasTool => currentTool != null; // 判断玩家是否已获得工具
|
||||
private Module currentModule;
|
||||
|
||||
public Transform faceCanvas;
|
||||
// public Transform faceCanvas;
|
||||
|
||||
private Vector3 originalCanvasPosition; // 原始面板位置
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ToolManager : MonoBehaviour
|
||||
|
||||
private void Start()
|
||||
{
|
||||
originalCanvasPosition=faceCanvas.position;
|
||||
//originalCanvasPosition=faceCanvas.position;
|
||||
currentModule=null;
|
||||
toolBox.SetActive(false); // 初始隐藏工具盒
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ToolManager : MonoBehaviour
|
||||
{
|
||||
//module.StartRepairIfToolIsScrewdriver(currentTool);
|
||||
currentModule=module;
|
||||
EnterRepairMode();
|
||||
//EnterRepairMode();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -171,33 +171,33 @@ public class ToolManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void EnterRepairMode()
|
||||
{
|
||||
isInRepiarMode=true;
|
||||
//isRepairMode = true;
|
||||
currentModule.RemoveAllPlugsFromSockets();
|
||||
// 使用 DOTween 对 Canvas 的位置和缩放进行平滑过渡
|
||||
faceCanvas.DOMove(currentModule.repairCanvasPosition, 1)
|
||||
.SetEase(Ease.OutQuad) // 移动面板
|
||||
.OnComplete(() => currentModule.EnableScrewsInteraction(true)); // 动画完成后才启用交互
|
||||
faceCanvas.DOScale(currentModule.repairCanvasScale, 1)
|
||||
.SetEase(Ease.OutQuad)
|
||||
.OnComplete(() => DialogController.Instance.StartDialogNode("EnterRepairMode")); // 缩放面板
|
||||
}
|
||||
// public void EnterRepairMode()
|
||||
// {
|
||||
// isInRepiarMode=true;
|
||||
// //isRepairMode = true;
|
||||
// currentModule.RemoveAllPlugsFromSockets();
|
||||
// // 使用 DOTween 对 Canvas 的位置和缩放进行平滑过渡
|
||||
// faceCanvas.DOMove(currentModule.repairCanvasPosition, 1)
|
||||
// .SetEase(Ease.OutQuad) // 移动面板
|
||||
// .OnComplete(() => currentModule.EnableScrewsInteraction(true)); // 动画完成后才启用交互
|
||||
// faceCanvas.DOScale(currentModule.repairCanvasScale, 1)
|
||||
// .SetEase(Ease.OutQuad)
|
||||
// .OnComplete(() => DialogController.Instance.StartDialogNode("EnterRepairMode")); // 缩放面板
|
||||
// }
|
||||
|
||||
[YarnCommand("ExitRepairMode")]
|
||||
public void ExitRepairMode()
|
||||
{
|
||||
isInRepiarMode=false;
|
||||
// 使用 DOTween 对 Canvas 的位置和缩放进行平滑过渡
|
||||
faceCanvas.DOMove(originalCanvasPosition, 1)
|
||||
.SetEase(Ease.InQuad);
|
||||
// [YarnCommand("ExitRepairMode")]
|
||||
// public void ExitRepairMode()
|
||||
// {
|
||||
// isInRepiarMode=false;
|
||||
// // 使用 DOTween 对 Canvas 的位置和缩放进行平滑过渡
|
||||
// faceCanvas.DOMove(originalCanvasPosition, 1)
|
||||
// .SetEase(Ease.InQuad);
|
||||
|
||||
faceCanvas.DOScale(1f, 1)
|
||||
.SetEase(Ease.InQuad); // 恢复面板缩放
|
||||
ShowToolBoxAfterTask();
|
||||
currentModule=null;
|
||||
}
|
||||
// faceCanvas.DOScale(1f, 1)
|
||||
// .SetEase(Ease.InQuad); // 恢复面板缩放
|
||||
// ShowToolBoxAfterTask();
|
||||
// currentModule=null;
|
||||
// }
|
||||
|
||||
|
||||
[YarnCommand("ShowTool")]
|
||||
|
||||
@@ -72,8 +72,7 @@ namespace AibisDream.FixSystem
|
||||
else if(data.ignoreWaveCheck)
|
||||
{
|
||||
_bodyModuleSystem.oscilloscopeSystem.ShowScreenMessage("无需检查,允许进入", Color.yellow);
|
||||
|
||||
//_bodyModuleSystem.oscilloscopeSystem.PlayWave(data.waveformType, data.waveHasError);
|
||||
_bodyModuleSystem.oscilloscopeSystem.ChangeDeepInButtonState(true);
|
||||
}
|
||||
else if(data.waveHasError)
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace AibisDream.FixSystem
|
||||
_scanLine.SetScreenSize(_screen.bounds.size.x, _screen.bounds.size.y);
|
||||
_screenText.text = "";
|
||||
|
||||
_deepinButton.OnButtonDown += StartScan;
|
||||
_deepinButton.OnButtonDown += HandleDeepInButtonClick;
|
||||
_scanLine.ScanErrorEvent += OnScanSuccess;
|
||||
}
|
||||
|
||||
@@ -91,6 +91,11 @@ namespace AibisDream.FixSystem
|
||||
_scanLine.CloseScan();
|
||||
}
|
||||
|
||||
public void ChangeDeepInButtonState(bool state)
|
||||
{
|
||||
_deepinButton.SetActive(state);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 调整相位
|
||||
/// </summary>
|
||||
@@ -112,12 +117,25 @@ namespace AibisDream.FixSystem
|
||||
float spikeX = _waveformLine.GetSpikeX();
|
||||
StartCoroutine(_scanLine.ScanForError(spikeX));
|
||||
}
|
||||
public void HandleDeepInButtonClick()
|
||||
{
|
||||
if(_bodyModuleSystem.CableSystem.curBodyModule.data.ignoreWaveCheck==true)
|
||||
{
|
||||
_bodyModuleSystem.HandleDeepIn();
|
||||
}
|
||||
else
|
||||
{
|
||||
StartScan();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 扫描成功后
|
||||
/// </summary>
|
||||
public void OnScanSuccess()
|
||||
{
|
||||
{
|
||||
_bodyModuleSystem.HandleDeepIn();
|
||||
_ = CommonUtil.Delay(2000, StopWave);
|
||||
}
|
||||
|
||||
@@ -79,9 +79,9 @@ public class MouseCursorManager : MonoBehaviour
|
||||
|
||||
}
|
||||
SetCursor(dialogueCursorSprite);
|
||||
dialogueCanvas.sortingOrder = 1000; // 确保对话窗口在最前
|
||||
dialogueCanvas.overrideSorting = true;
|
||||
dialogueCanvas.GetComponent<GraphicRaycaster>().blockingMask = LayerMask.GetMask("Everything");
|
||||
// dialogueCanvas.sortingOrder = 1000; // 确保对话窗口在最前
|
||||
// dialogueCanvas.overrideSorting = true;
|
||||
//dialogueCanvas.GetComponent<GraphicRaycaster>().blockingMask = LayerMask.GetMask("Everything");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -91,8 +91,8 @@ public class MouseCursorManager : MonoBehaviour
|
||||
|
||||
}
|
||||
|
||||
dialogueCanvas.overrideSorting = false;
|
||||
dialogueCanvas.GetComponent<GraphicRaycaster>().blockingMask = LayerMask.GetMask("Nothing");
|
||||
//dialogueCanvas.overrideSorting = false;
|
||||
//dialogueCanvas.GetComponent<GraphicRaycaster>().blockingMask = LayerMask.GetMask("Nothing");
|
||||
|
||||
if(isDraggingPlug)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user