旧资源清理
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using AibisDream.FixSystem;
|
||||
using UnityEngine.UI;
|
||||
using Unity.VisualScripting;
|
||||
using AibisDream;
|
||||
using AibisDream.Kit;
|
||||
|
||||
public class PunchTapeSystem : MonoBehaviour
|
||||
@@ -14,40 +11,29 @@ public class PunchTapeSystem : MonoBehaviour
|
||||
public RectTransform punchTape;
|
||||
|
||||
public GameObject blackPanel;
|
||||
public float stepInterval = 0.1f; // Interval between each printing step
|
||||
public float stepDistance = 0.5f; // Distance moved per step
|
||||
public float[] stepPatterns = { 0.3f, 0.5f, 0.2f, 0.4f, 0.6f }; // Pattern of intervals to simulate rhythmic printing
|
||||
|
||||
public float[]
|
||||
stepPatterns = { 0.3f, 0.5f, 0.2f, 0.4f, 0.6f }; // Pattern of intervals to simulate rhythmic printing
|
||||
|
||||
public GameObject tempPunchTapeGroup;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
}
|
||||
|
||||
// public void Update()
|
||||
// {
|
||||
// if (Input.GetKeyDown(KeyCode.P))
|
||||
// {
|
||||
// StartPrinting(2);
|
||||
// }
|
||||
// }
|
||||
|
||||
public void StartPrinting(int tapeCount)
|
||||
{
|
||||
StartCoroutine(PrintPunchTapes(tapeCount));
|
||||
}
|
||||
|
||||
public IEnumerator PrintPunchTapes(int tapeCount)
|
||||
{
|
||||
blackPanel.SetActive(true);
|
||||
Vector3 machineStartPos = punchTapeMachine.anchoredPosition;
|
||||
Vector3 tapeStartPos = punchTape.anchoredPosition;
|
||||
Color tapeStartColor = punchTape.GetComponent<Image>().color;
|
||||
|
||||
while (tapeCount > 0)
|
||||
{
|
||||
// Move the printer to x = 2 over 1 second
|
||||
yield return punchTapeMachine.DOAnchorPos(new Vector2(-1252f, punchTapeMachine.anchoredPosition.y), 1f).WaitForCompletion();
|
||||
yield return punchTapeMachine.DOAnchorPos(new Vector2(-1252f, punchTapeMachine.anchoredPosition.y), 1f)
|
||||
.WaitForCompletion();
|
||||
AudioManager.Instance.PlaySfx("event:/Scriptal/typing");
|
||||
// Gradually move the punch tape to x = -3.8 with rhythmic pattern
|
||||
Vector2 targetPosition = new Vector2(796f, punchTape.anchoredPosition.y);
|
||||
@@ -55,7 +41,8 @@ public class PunchTapeSystem : MonoBehaviour
|
||||
|
||||
while (Vector2.Distance(punchTape.anchoredPosition, targetPosition) > stepDistance)
|
||||
{
|
||||
punchTape.anchoredPosition = Vector3.MoveTowards(punchTape.anchoredPosition, targetPosition, stepDistance);
|
||||
punchTape.anchoredPosition =
|
||||
Vector3.MoveTowards(punchTape.anchoredPosition, targetPosition, stepDistance);
|
||||
yield return new WaitForSeconds(stepPatterns[patternIndex % stepPatterns.Length]);
|
||||
patternIndex++;
|
||||
}
|
||||
@@ -75,23 +62,24 @@ public class PunchTapeSystem : MonoBehaviour
|
||||
}
|
||||
|
||||
// Move the printer back to x = 0 over 1 second
|
||||
yield return punchTapeMachine.DOAnchorPos(new Vector2(-1428.186f, punchTapeMachine.anchoredPosition.y), 1f).WaitForCompletion();
|
||||
yield return punchTapeMachine.DOAnchorPos(new Vector2(-1428.186f, punchTapeMachine.anchoredPosition.y), 1f)
|
||||
.WaitForCompletion();
|
||||
blackPanel.SetActive(false);
|
||||
}
|
||||
|
||||
public void Temp_showPunchTapeGroup()
|
||||
{
|
||||
tempPunchTapeGroup.SetActive(true);
|
||||
}
|
||||
|
||||
public IEnumerator Temp_HidePunchTapeGroup()
|
||||
{
|
||||
foreach(SpriteRenderer s in tempPunchTapeGroup.GetComponentsInChildren<SpriteRenderer>())
|
||||
foreach (SpriteRenderer s in tempPunchTapeGroup.GetComponentsInChildren<SpriteRenderer>())
|
||||
{
|
||||
s.DOFade(0,0.5f);
|
||||
s.DOFade(0, 0.5f);
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
tempPunchTapeGroup.SetActive(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user