2025-06-13 14:59:58 -04:00
|
|
|
using System;
|
2025-06-06 10:14:55 -04:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
2025-07-26 04:20:25 -04:00
|
|
|
using DG.Tweening;
|
2025-07-08 14:28:40 -04:00
|
|
|
using Ichni.Menu.UI;
|
2025-06-13 14:59:58 -04:00
|
|
|
using Ichni.RhythmGame;
|
2025-06-14 14:42:49 -04:00
|
|
|
using Ichni.UI;
|
2025-06-13 14:59:58 -04:00
|
|
|
using Sirenix.OdinInspector;
|
2025-06-06 10:14:55 -04:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
2025-06-13 14:59:58 -04:00
|
|
|
namespace Ichni.Menu
|
2025-06-06 10:14:55 -04:00
|
|
|
{
|
2025-06-13 14:59:58 -04:00
|
|
|
public partial class SongSelectionManager : SerializedMonoBehaviour
|
2025-06-06 10:14:55 -04:00
|
|
|
{
|
2025-06-13 14:59:58 -04:00
|
|
|
public static SongSelectionManager instance;
|
2025-06-14 14:42:49 -04:00
|
|
|
|
|
|
|
|
public SongSelectionUIPage songSelectionUIPage;
|
2025-07-26 04:20:25 -04:00
|
|
|
|
|
|
|
|
public float currentFilterValue;
|
|
|
|
|
public Tweener filterTweener;
|
2025-06-13 14:59:58 -04:00
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
instance = this;
|
2025-07-26 04:20:25 -04:00
|
|
|
currentFilterValue = 100f;
|
2025-06-13 14:59:58 -04:00
|
|
|
}
|
2025-06-06 10:14:55 -04:00
|
|
|
|
|
|
|
|
}
|
2025-06-13 14:59:58 -04:00
|
|
|
|
|
|
|
|
public partial class SongSelectionManager
|
2025-06-06 10:14:55 -04:00
|
|
|
{
|
2025-07-26 04:20:25 -04:00
|
|
|
public void SetPreview(SongItemData connectedSong, bool isLocked)
|
|
|
|
|
{
|
|
|
|
|
MenuAudioManager.instance.audioContainer.StopEvent("PlayPreview");
|
|
|
|
|
MenuAudioManager.instance.audioContainer.SetSwitch(connectedSong.songSwitch);
|
|
|
|
|
MenuAudioManager.instance.audioContainer.PostEvent("PlayPreview");
|
2025-06-13 14:59:58 -04:00
|
|
|
|
2025-07-26 04:20:25 -04:00
|
|
|
float targetFilterValue = isLocked ? 50 : 100;
|
|
|
|
|
if (!Mathf.Approximately(currentFilterValue, targetFilterValue))
|
|
|
|
|
{
|
|
|
|
|
filterTweener.Kill(true);
|
|
|
|
|
filterTweener =
|
|
|
|
|
DOTween.To(() => currentFilterValue, x => currentFilterValue = x, targetFilterValue, 1f)
|
|
|
|
|
.SetEase(Ease.OutQuad)
|
|
|
|
|
.OnUpdate(() =>
|
|
|
|
|
{
|
|
|
|
|
MenuAudioManager.instance.audioContainer.SetRTPC("PreviewLowPassFilter", currentFilterValue);
|
|
|
|
|
}).Play();
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-06-06 10:14:55 -04:00
|
|
|
}
|
2025-06-13 14:59:58 -04:00
|
|
|
}
|