feat(fix-system): 重构打孔带流程并接入新收藏与插槽系统
Made-with: Cursor
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System.Collections;
|
||||
using AibisDream.FixSystem;
|
||||
using Yarn.Unity;
|
||||
using UnityEngine;
|
||||
@@ -8,7 +7,6 @@ namespace AibisDream
|
||||
public static class BodyModuleYarnCommand
|
||||
{
|
||||
private static BodyModuleSystem BodyModuleSystem => FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
private static PunchTapeSystem PunchTapeSystem => FixSystemCenter.SystemDic.Get<PunchTapeSystem>();
|
||||
private static CablePanel CablePanel => FixPanelSystem.GetRepairPanel<CablePanel>();
|
||||
|
||||
[YarnCommand("enable_cut")]
|
||||
@@ -133,12 +131,6 @@ namespace AibisDream
|
||||
targetModule.Alarm(enable);
|
||||
}
|
||||
|
||||
[YarnCommand("PrintPunchTapes")]
|
||||
public static IEnumerator PrintPunchTapes(int count)
|
||||
{
|
||||
yield return PunchTapeSystem.StartCoroutine(PunchTapeSystem.PrintPunchTapes(count));
|
||||
}
|
||||
|
||||
[YarnCommand("DropCable")]
|
||||
public static void DropCable()
|
||||
{
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
using System.Collections;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using AibisDream.FixSystem;
|
||||
using UnityEngine.UI;
|
||||
using AibisDream.Kit;
|
||||
|
||||
public class PunchTapeSystem : MonoBehaviour
|
||||
{
|
||||
public RectTransform punchTapeMachine;
|
||||
public RectTransform punchTape;
|
||||
|
||||
public GameObject blackPanel;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
FixSystemCenter.SystemDic.Unregister<PunchTapeSystem>();
|
||||
}
|
||||
|
||||
public IEnumerator PrintPunchTapes(int tapeCount)
|
||||
{
|
||||
blackPanel.SetActive(true);
|
||||
Vector3 tapeStartPos = punchTape.anchoredPosition;
|
||||
Color tapeStartColor = punchTape.GetComponent<Image>().color;
|
||||
|
||||
while (tapeCount > 0)
|
||||
{
|
||||
// 0-0.7秒:打印机移动到指定位置
|
||||
AudioManager.Instance.PlaySfx("event:/Scriptal/typing");
|
||||
yield return punchTapeMachine.DOAnchorPos(new Vector2(-1252f, punchTapeMachine.anchoredPosition.y), 0.7f)
|
||||
.WaitForCompletion();
|
||||
|
||||
|
||||
// 0.7-1秒:停顿
|
||||
yield return new WaitForSeconds(0.3f);
|
||||
|
||||
// 1-1.6秒:纸带匀速弹出
|
||||
Vector2 targetPosition = new Vector2(796f, punchTape.anchoredPosition.y);
|
||||
yield return punchTape.DOAnchorPos(targetPosition, 0.6f).WaitForCompletion();
|
||||
|
||||
// 1.6-2.3秒:停顿
|
||||
yield return new WaitForSeconds(0.7f);
|
||||
|
||||
// 2.3-2.7秒:纸带淡出
|
||||
yield return punchTape.GetComponent<Image>().DOFade(0f, 0.4f).WaitForCompletion();
|
||||
|
||||
// 重置纸带位置和透明度
|
||||
punchTape.anchoredPosition = tapeStartPos;
|
||||
punchTape.GetComponent<Image>().color = tapeStartColor;
|
||||
|
||||
tapeCount--;
|
||||
}
|
||||
|
||||
// 打印机返回原位
|
||||
yield return punchTapeMachine.DOAnchorPos(new Vector2(-1428.186f, punchTapeMachine.anchoredPosition.y), 1f)
|
||||
.WaitForCompletion();
|
||||
blackPanel.SetActive(false);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4075ea95a82355544862690e0de983bd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user