改动与优化

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
@@ -250,13 +250,14 @@ public class SongSelectUI : MonoBehaviour
root.DOKill();
cg.DOKill();
float moveOffset = list_Move_Offset;
if (root.GetComponent<LayoutGroup>() != null)
bool canMove = !UI_OrderedEntryAnimator.IsLayoutSensitive(root);
if (!canMove)
{
moveOffset = 0f;
}
Sequence seq = DOTween.Sequence().SetUpdate(list_Use_Unscaled);
seq.Join(cg.DOFade(0f, list_FadeOut_Time));
if (Mathf.Abs(moveOffset) > 0.01f)
if (canMove && Mathf.Abs(moveOffset) > 0.01f)
{
seq.Join(root.DOAnchorPos(listBasePos + new Vector2(-moveOffset, 0f), list_FadeOut_Time).SetEase(list_Move_Ease));
}
@@ -283,22 +284,23 @@ public class SongSelectUI : MonoBehaviour
root.DOKill();
cg.DOKill();
float moveOffset = list_Move_Offset;
if (root.GetComponent<LayoutGroup>() != null)
bool canMove = !UI_OrderedEntryAnimator.IsLayoutSensitive(root);
if (!canMove)
{
moveOffset = 0f;
}
if (Mathf.Abs(moveOffset) > 0.01f)
if (canMove && Mathf.Abs(moveOffset) > 0.01f)
{
root.anchoredPosition = listBasePos + new Vector2(moveOffset, 0f);
}
else
else if (canMove)
{
root.anchoredPosition = listBasePos;
}
cg.alpha = 0f;
Sequence seq = DOTween.Sequence().SetUpdate(list_Use_Unscaled);
seq.Join(cg.DOFade(1f, list_FadeIn_Time));
if (Mathf.Abs(moveOffset) > 0.01f)
if (canMove && Mathf.Abs(moveOffset) > 0.01f)
{
seq.Join(root.DOAnchorPos(listBasePos, list_FadeIn_Time).SetEase(list_Move_Ease));
}
@@ -421,6 +423,7 @@ public class SongSelectUI : MonoBehaviour
GameObject songButtonObj = Instantiate(songButtonPrefab, contentPanel);
songButtonObj.transform.SetParent(contentPanel, false);
UI_OrderedEntryAnimator.PlayFadeOnly(songButtonObj, contentPanel.childCount - 1, 0.16f, 0.01f, true);
SongData sd = song;
if (SongDataLibrary.Instance != null && SongDataLibrary.Instance.IsLoaded)
+5
View File
@@ -631,6 +631,11 @@ public class SongDetailsUI : MonoBehaviour
rect.localScale = Vector3.one;
rect.anchoredPosition3D = Vector3.zero;
}
if (panel.GetComponent<UI_PanelPopupTween>() == null)
{
panel.AddComponent<UI_PanelPopupTween>();
}
}
private void RegisterManagedOverlay(GameObject panel, Action closeAction)
+31 -1
View File
@@ -4,6 +4,7 @@ using UnityEngine.EventSystems;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using DG.Tweening;
public class dlcButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
@@ -74,7 +75,7 @@ public class dlcButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandle
public void OnPointerExit(PointerEventData eventData)
{
if (hoverCoroutine != null) StopCoroutine(hoverCoroutine);
if (dlcDetailParent != null) dlcDetailParent.SetActive(false);
HideDlcDetail();
}
public void SetDlcData(dlcData so)
@@ -105,6 +106,7 @@ public class dlcButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandle
if (dlcDetailParent != null)
{
dlcDetailParent.SetActive(true);
UI_OrderedEntryAnimator.PlayFadeOnly(dlcDetailParent, 0, 0.12f, 0f, true);
// 鏇存柊绠€浠嬩俊鎭?
if (dlcDescription != null)
{
@@ -122,6 +124,34 @@ public class dlcButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandle
}
}
private void HideDlcDetail()
{
if (dlcDetailParent == null)
{
return;
}
CanvasGroup group = dlcDetailParent.GetComponent<CanvasGroup>();
if (group == null)
{
group = dlcDetailParent.AddComponent<CanvasGroup>();
}
group.DOKill();
group.DOFade(0f, 0.1f)
.SetEase(Ease.OutQuad)
.SetUpdate(true)
.SetTarget(dlcDetailParent)
.OnComplete(() =>
{
if (dlcDetailParent != null)
{
dlcDetailParent.SetActive(false);
group.alpha = 1f;
}
});
}
void Awake()
{
_btn = GetComponent<Button>();
@@ -61,6 +61,7 @@ public class loadDlcListPrefab : MonoBehaviour
{
var headerGO = Instantiate(columnPrefab, dlc_scContent.transform);
headerGO.name = "Column_" + colIndex;
UI_OrderedEntryAnimator.PlayFadeOnly(headerGO, dlc_scContent.transform.childCount - 1, 0.14f, 0.008f, true);
var card = headerGO.GetComponent<columnCardPrefab>();
if (card != null && card.columnNameText != null)
@@ -87,6 +88,7 @@ public class loadDlcListPrefab : MonoBehaviour
var itemGO = Instantiate(dlcButtonPrefab, dlc_scContent.transform);
itemGO.name = $"DLC_Col{colIndex}_Item{entryIndex}";
UI_OrderedEntryAnimator.PlayFadeOnly(itemGO, dlc_scContent.transform.childCount - 1, 0.16f, 0.01f, true);
var btn = itemGO.GetComponent<dlcButton>();
if (btn != null)
+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);