update
This commit is contained in:
@@ -35,18 +35,29 @@ namespace Ichni.UI
|
||||
public Image avatarMask;
|
||||
public TMP_Text decorationChapterText0;
|
||||
public TMP_Text decorationChapterText1;
|
||||
public TMP_Text progressText;
|
||||
public TMP_Text outerSongProgressText;
|
||||
public RectTransform titleRect;
|
||||
public TMP_Text titleText;
|
||||
|
||||
[Title("展开内容")]
|
||||
[Title("展开内容")]
|
||||
public RectTransform expansionBackground;
|
||||
public Image expansionRipple;
|
||||
public Material rippleMaterial;
|
||||
public Sequence rippleSequence;
|
||||
|
||||
public RectTransform expansionFunctions;
|
||||
|
||||
public RectTransform expansionInfos;
|
||||
|
||||
public TMP_Text innerSongProgressText;
|
||||
public TMP_Text fullComboText;
|
||||
public TMP_Text allPerfectText;
|
||||
public TMP_Text beatmapProgressText;
|
||||
|
||||
|
||||
public void Initialize(ChapterSelectionUnit chapter)
|
||||
{
|
||||
connectedChapter = chapter;
|
||||
expansionRipple.material = new Material(rippleMaterial);
|
||||
|
||||
expandButton.onClick.AddListener(() =>
|
||||
{
|
||||
@@ -90,6 +101,14 @@ namespace Ichni.UI
|
||||
ChapterSelectionManager.instance.chapterSelectionUIPage.FadeOut();
|
||||
SongSelectionManager.instance.songSelectionUIPage.FadeIn();
|
||||
});
|
||||
|
||||
(int beatmapCount, int finishedSongCount, int finishedBeatmapCount, int fullComboCount, int allPerfectCount) = chapter.GetChapterSaveInfo();
|
||||
float songProgressPercent = (float)finishedSongCount / chapter.songs.Count * 100f;
|
||||
outerSongProgressText.text = songProgressPercent.ToString("F2") + "%";
|
||||
innerSongProgressText.text = songProgressPercent.ToString("F2") + "%";
|
||||
fullComboText.text = fullComboCount.ToString();
|
||||
allPerfectText.text = allPerfectCount.ToString();
|
||||
beatmapProgressText.text = $"{finishedBeatmapCount}/{beatmapCount}";
|
||||
}
|
||||
|
||||
private void Expand()
|
||||
@@ -122,7 +141,16 @@ namespace Ichni.UI
|
||||
expandSequence.Join(upperTip.DOFade(1f, 0.3f));
|
||||
|
||||
expandSequence.OnStart(() => isDuringAnimation = true);
|
||||
expandSequence.OnComplete(() => isDuringAnimation = false);
|
||||
expandSequence.OnComplete(() =>
|
||||
{
|
||||
isDuringAnimation = false;
|
||||
expansionRipple.material.SetFloat("_RippleTime", 0f);
|
||||
rippleSequence = DOTween.Sequence();
|
||||
rippleSequence.AppendInterval(5f);
|
||||
rippleSequence.Append(expansionRipple.material.DOFloat(1, "_RippleTime", 2f));
|
||||
rippleSequence.SetLoops(-1);
|
||||
rippleSequence.Play();
|
||||
});
|
||||
|
||||
expandSequence.Play();
|
||||
}
|
||||
@@ -131,6 +159,8 @@ namespace Ichni.UI
|
||||
{
|
||||
isExpanded = false;
|
||||
|
||||
rippleSequence?.Kill(true);
|
||||
|
||||
Sequence shrinkSequence = DOTween.Sequence();
|
||||
|
||||
shrinkSequence.Append(bottomTip.DOFade(0f, 0.3f));
|
||||
@@ -147,18 +177,17 @@ namespace Ichni.UI
|
||||
expansionFunctions.gameObject.SetActive(false);
|
||||
}));
|
||||
|
||||
shrinkSequence.Join(titleRect.DOSizeDelta(new Vector2(322, 100), 0.3f).SetEase(Ease.InQuad));
|
||||
shrinkSequence.Join(titleRect.DOSizeDelta(new Vector2(322, 100), 0.3f));
|
||||
|
||||
shrinkSequence.Append(expansionBackground.DOSizeDelta(new Vector2(322, 826), 0.3f)
|
||||
.SetEase(Ease.InQuad)
|
||||
.OnComplete(() =>
|
||||
{
|
||||
expansionBackground.gameObject.SetActive(false);
|
||||
}));
|
||||
|
||||
shrinkSequence.Join(DOTween.To(() => layoutElement.preferredWidth,
|
||||
x => layoutElement.preferredWidth = x, 322, 0.3f).SetEase(Ease.InQuad));
|
||||
shrinkSequence.Join(avatarMask.rectTransform.DOSizeDelta(new Vector2(322, 826), 0.3f).SetEase(Ease.InQuad));
|
||||
x => layoutElement.preferredWidth = x, 322, 0.3f));
|
||||
shrinkSequence.Join(avatarMask.rectTransform.DOSizeDelta(new Vector2(322, 826), 0.3f));
|
||||
|
||||
shrinkSequence.OnStart(() => isDuringAnimation = true);
|
||||
shrinkSequence.OnComplete(() => isDuringAnimation = false);
|
||||
|
||||
@@ -15,6 +15,8 @@ namespace Ichni.UI
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
fadeInStartAction = Initialize;
|
||||
|
||||
settingsButton.onClick.AddListener(() =>
|
||||
{
|
||||
@@ -23,8 +25,14 @@ namespace Ichni.UI
|
||||
});
|
||||
}
|
||||
|
||||
private void Start()
|
||||
private void Initialize()
|
||||
{
|
||||
// Clear existing chapters
|
||||
foreach (Transform child in chapterContainer)
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
|
||||
foreach (var chapter in ChapterSelectionManager.instance.chapters)
|
||||
{
|
||||
ChapterSelectionUI item = Instantiate(chapterSelectionUIPrefab, chapterContainer).GetComponent<ChapterSelectionUI>();
|
||||
|
||||
Reference in New Issue
Block a user