改动与优化

This commit is contained in:
FloatGaming
2026-07-20 22:19:25 +08:00
parent 0a0872c4f4
commit b5d1cdcbc5
83 changed files with 2475 additions and 276 deletions
+32 -8
View File
@@ -387,9 +387,10 @@ public class selected_songInfo : MonoBehaviour
blackMaskImage.DOKill();
}
if (Music_Mgr.Singleton != null && Music_Mgr.Singleton.AudioSource != null)
AudioSource globalMusicSource = GetGlobalMusicSource();
if (globalMusicSource != null)
{
Music_Mgr.Singleton.AudioSource.DOKill();
globalMusicSource.DOKill();
}
}
@@ -668,13 +669,26 @@ public class selected_songInfo : MonoBehaviour
private void FadeGlobalMusic(bool fadeIn)
{
if (Music_Mgr.Singleton != null && Music_Mgr.Singleton.AudioSource != null)
AudioSource globalMusicSource = GetGlobalMusicSource();
if (globalMusicSource != null)
{
float targetVolume = fadeIn ? 1f : 0f;
Music_Mgr.Singleton.AudioSource.DOFade(targetVolume, 0.5f).SetUpdate(true);
globalMusicSource.DOFade(targetVolume, 0.5f).SetUpdate(true);
}
}
private static AudioSource GetGlobalMusicSource()
{
BgmPlaybackManager bgm = BgmPlaybackManager.Instance;
if (bgm != null && bgm.audioSource != null)
{
return bgm.audioSource;
}
Music_Mgr musicManager = SceneObjectLookupCache.FindAny<Music_Mgr>();
return musicManager != null ? musicManager.AudioSource : null;
}
private void OnSliderValueChanged(float value)
{
if (preListenAS == null || preListenAS.clip == null) return;
@@ -1009,10 +1023,17 @@ public class selected_songInfo : MonoBehaviour
songInfo_BaseCached = true;
songInfo_Root.DOKill();
songInfo_Canvas.DOKill();
songInfo_Root.anchoredPosition = songInfo_BasePos + new Vector2(-songSwitch_Move, 0f);
bool canMove = !UI_OrderedEntryAnimator.IsLayoutSensitive(songInfo_Root);
if (canMove)
{
songInfo_Root.anchoredPosition = songInfo_BasePos + new Vector2(-songSwitch_Move, 0f);
}
songInfo_Canvas.alpha = 0f;
Sequence seq = DOTween.Sequence().SetUpdate(switch_Use_Unscaled);
seq.Join(songInfo_Root.DOAnchorPos(songInfo_BasePos, songSwitch_Time).SetEase(songSwitch_Ease));
if (canMove)
{
seq.Join(songInfo_Root.DOAnchorPos(songInfo_BasePos, songSwitch_Time).SetEase(songSwitch_Ease));
}
seq.Join(songInfo_Canvas.DOFade(1f, songSwitch_Time));
}
@@ -1030,8 +1051,11 @@ public class selected_songInfo : MonoBehaviour
Transform t = btn.transform;
t.DOKill();
t.localScale = Vector3.one;
t.DOPunchScale(Vector3.one * diffSwitch_Punch, diffSwitch_Punch_Time, 6, 0.7f)
.SetUpdate(switch_Use_Unscaled);
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(btn.transform as RectTransform))
{
t.DOPunchScale(Vector3.one * diffSwitch_Punch, diffSwitch_Punch_Time, 6, 0.7f)
.SetUpdate(switch_Use_Unscaled);
}
}
}
FlashGraphic(currentDifficulty);