75 lines
2.4 KiB
C#
75 lines
2.4 KiB
C#
using DG.Tweening;
|
|
using Ichni.RhythmGame;
|
|
using Ichni.UI;
|
|
using UnityEngine.Events;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.UI.Extensions;
|
|
|
|
namespace Ichni.Menu
|
|
{
|
|
public partial class SongSelectionUIPage : UIPageBase
|
|
{
|
|
public Button backButton;
|
|
|
|
public Gradient2 backgroundFrames;
|
|
public float framePositionOffset = -1;
|
|
|
|
public SongListControllerUI songListController;
|
|
public PlaySongUI playSongUI;
|
|
public SongInfoUI songInfoUI;
|
|
public DifficultySelectionContainer difficultySelectionContainer;
|
|
//public int currentSelectedDifficultyIndex;
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
|
|
fadeOutAction = () =>
|
|
{
|
|
songListController.ClearSongTabs();
|
|
MenuInputManager.OnMoveUp -= songListController.GoToFormerTab;
|
|
MenuInputManager.OnMoveDown -= songListController.GoToNextTab;
|
|
};
|
|
|
|
fadeInStartAction = () =>
|
|
{
|
|
songListController.InitializeList();
|
|
};
|
|
|
|
fadeInFinishAction = () =>
|
|
{
|
|
MenuInputManager.OnMoveUp += songListController.GoToFormerTab;
|
|
MenuInputManager.OnMoveDown += songListController.GoToNextTab;
|
|
};
|
|
|
|
backButton.onClick.AddListener(() =>
|
|
{
|
|
FadeOut();
|
|
MenuManager.instance.chapterSelectionUIPage.FadeIn();
|
|
MenuAudioManager.instance.audioContainer.StopEvent("PlayPreview");
|
|
});
|
|
|
|
songInfoUI.SetUp();
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
MenuInformationRecorder.instance.GetRecordOfThisChapter().difficultyIndex = 0;
|
|
|
|
Sequence framesSeq = DOTween.Sequence();
|
|
framesSeq.Append(DOTween.To(() => framePositionOffset, x => framePositionOffset = x, 1f, 1f)
|
|
.SetEase(Ease.Linear)
|
|
.OnUpdate(() => backgroundFrames.Offset = framePositionOffset));
|
|
framesSeq.AppendInterval(4f);
|
|
framesSeq.SetLoops(-1, LoopType.Restart);
|
|
framesSeq.Play();
|
|
}
|
|
}
|
|
|
|
public partial class SongSelectionUIPage
|
|
{
|
|
public SongItemData selectedSong;
|
|
public DifficultyData selectedDifficulty;
|
|
public SongStatusSave selectedSave;
|
|
}
|
|
} |