重构暂存
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")]
|
||||
|
||||
Reference in New Issue
Block a user