update
This commit is contained in:
@@ -1,19 +1,69 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using Ichni.UI;
|
||||
using Michsky.MUIP;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Ichni.RhythmGame.UI
|
||||
{
|
||||
public class GameLoadingCanvas : UIPageBase
|
||||
{
|
||||
public bool allPartsSet;
|
||||
public RectTransform leftParts;
|
||||
public RectTransform rightParts;
|
||||
|
||||
public TMP_Text progressText;
|
||||
public RectTransform progressMark;
|
||||
public ProgressBar progressBar;
|
||||
|
||||
public TMP_Text songNameText;
|
||||
public Image illustrationImage;
|
||||
public TMP_Text difficultyText;
|
||||
public TMP_Text levelText;
|
||||
|
||||
public TMP_Text composerText;
|
||||
public TMP_Text illustratorText;
|
||||
public TMP_Text chartDesignerText;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
InformationTransistor info = InformationTransistor.instance;
|
||||
|
||||
songNameText.text = info.song.songName;
|
||||
illustrationImage.sprite = info.song.illustration;
|
||||
difficultyText.text = info.difficulty.GetDifficultyName();
|
||||
levelText.text = info.difficulty.difficultyValue.ToString();
|
||||
composerText.text = info.song.composer;
|
||||
illustratorText.text = info.song.illustratorName;
|
||||
chartDesignerText.text = info.difficulty.charterName;
|
||||
}
|
||||
|
||||
public void SetProgress(float value)
|
||||
{
|
||||
progressBar.currentPercent = value;
|
||||
progressText.text = Mathf.RoundToInt(value) + "%";
|
||||
float markXPosition = 1920 * (value / 100f);
|
||||
progressMark.anchoredPosition = new Vector2(markXPosition, progressMark.anchoredPosition.y);
|
||||
progressBar.UpdateUI();
|
||||
}
|
||||
|
||||
public void MoveParts()
|
||||
{
|
||||
leftParts.anchoredPosition = new Vector2(-1030f, 0f);
|
||||
rightParts.anchoredPosition = new Vector2(250, 0f);
|
||||
allPartsSet = false;
|
||||
|
||||
leftParts.DOAnchorPosX(1030f, 0.5f).OnComplete(() => allPartsSet = true).Play();
|
||||
rightParts.DOAnchorPosX(-250f, 0.5f).Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user