menu
This commit is contained in:
@@ -29,13 +29,15 @@ namespace Ichni.Menu
|
||||
{
|
||||
if(song.difficultyDataList.All(d => d.difficultyName != "Easy"))
|
||||
{
|
||||
song.difficultyDataList.Add(new DifficultyData(0, "Easy","", 0, "",
|
||||
song.difficultyDataList.Add(new DifficultyData(
|
||||
0, "Easy","Easy", 0, "",
|
||||
new Color(0f, 0.7f, 0.2f, 1f)));
|
||||
}
|
||||
|
||||
if (song.difficultyDataList.All(d => d.difficultyName != "Hard"))
|
||||
{
|
||||
song.difficultyDataList.Add(new DifficultyData(1,"Hard", "", 0, "",
|
||||
song.difficultyDataList.Add(new DifficultyData(
|
||||
1,"Hard", "Hard", 0, "",
|
||||
new Color(1f, 0.2f, 0.2f, 1f)));
|
||||
}
|
||||
}
|
||||
@@ -75,6 +77,9 @@ namespace Ichni.Menu
|
||||
|
||||
[FoldoutGroup("$songName")]
|
||||
public List<DifficultyData> difficultyDataList;
|
||||
|
||||
[FoldoutGroup("$songName")]
|
||||
public string unlockKey;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
@@ -12,6 +12,9 @@ namespace Ichni.Menu
|
||||
public static MenuAudioManager instance;
|
||||
|
||||
public AudioContainer audioContainer;
|
||||
|
||||
public Switch testCptSwitch;
|
||||
public Switch testSongSwitch;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using Ichni.Menu.UI;
|
||||
using Ichni.RhythmGame;
|
||||
using Ichni.UI;
|
||||
@@ -14,17 +15,38 @@ namespace Ichni.Menu
|
||||
public static SongSelectionManager instance;
|
||||
|
||||
public SongSelectionUIPage songSelectionUIPage;
|
||||
|
||||
|
||||
public float currentFilterValue;
|
||||
public Tweener filterTweener;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
currentFilterValue = 100f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public partial class SongSelectionManager
|
||||
{
|
||||
public void SetPreview(SongItemData connectedSong, bool isLocked)
|
||||
{
|
||||
MenuAudioManager.instance.audioContainer.StopEvent("PlayPreview");
|
||||
MenuAudioManager.instance.audioContainer.SetSwitch(connectedSong.songSwitch);
|
||||
MenuAudioManager.instance.audioContainer.PostEvent("PlayPreview");
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user