客户端rsa,冗余清理,bug修复,安卓build问题
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -5,8 +5,11 @@ using UnityEngine.SceneManagement;
|
||||
using UnityEngine.EventSystems;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Audio;
|
||||
using DG.Tweening;
|
||||
using Bansonic;
|
||||
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX
|
||||
using Steamworks;
|
||||
#endif
|
||||
using GameServer.Client;
|
||||
|
||||
public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
@@ -24,6 +27,12 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
public Text player_mmrFragment;
|
||||
public Text player_rks;
|
||||
public Image rksProgressImage;
|
||||
[Header("currency hover")]
|
||||
public Button mmrFragmentHoverButton;
|
||||
public Button coinsHoverButton;
|
||||
public CanvasGroup mmrFragmentHoverCanvasGroup;
|
||||
public CanvasGroup coinsHoverCanvasGroup;
|
||||
[Min(0.01f)] public float currencyHoverFadeDuration = 0.25f;
|
||||
[Header("put prefabs here")]
|
||||
public GameObject putPrefabsHere;
|
||||
public GameObject putSettingsPrefabHere;
|
||||
@@ -135,6 +144,8 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
private RectTransform topNavigationRoot;
|
||||
private bool topNavigationGeometryDirty = true;
|
||||
private int lastTopNavigationParentChildCount = -1;
|
||||
private Tween mmrFragmentHoverTween;
|
||||
private Tween coinsHoverTween;
|
||||
|
||||
private static readonly List<string> sceneHistory = new List<string>();
|
||||
private static bool sceneHistoryHooked = false;
|
||||
@@ -159,6 +170,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
float currentRks = PlayerRksService.GetBestOverallRks(player_SO);
|
||||
UpdatePlayerRksText(currentRks);
|
||||
UpdateRksProgressImage(currentRks);
|
||||
SetupCurrencyHoverIndicators();
|
||||
|
||||
if (button_Music == null)
|
||||
{
|
||||
@@ -538,6 +550,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
StopCoroutine(musicPicFade);
|
||||
musicPicFade = null;
|
||||
}
|
||||
KillCurrencyHoverTweens();
|
||||
musicPicGroup = null;
|
||||
if (settings_launch != null)
|
||||
settings_launch.onClick.RemoveListener(instantiateSettings);
|
||||
@@ -593,6 +606,107 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupCurrencyHoverIndicators()
|
||||
{
|
||||
InitializeCurrencyHoverCanvasGroup(mmrFragmentHoverCanvasGroup);
|
||||
InitializeCurrencyHoverCanvasGroup(coinsHoverCanvasGroup);
|
||||
|
||||
AttachCurrencyHoverListener(mmrFragmentHoverButton, true);
|
||||
AttachCurrencyHoverListener(coinsHoverButton, false);
|
||||
}
|
||||
|
||||
private void InitializeCurrencyHoverCanvasGroup(CanvasGroup targetGroup)
|
||||
{
|
||||
if (targetGroup == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
targetGroup.DOKill();
|
||||
targetGroup.alpha = 0f;
|
||||
targetGroup.interactable = false;
|
||||
targetGroup.blocksRaycasts = false;
|
||||
}
|
||||
|
||||
private void AttachCurrencyHoverListener(Button targetButton, bool isFragmentButton)
|
||||
{
|
||||
if (targetButton == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
btmandtopCurrencyHoverRelay relay = targetButton.GetComponent<btmandtopCurrencyHoverRelay>();
|
||||
if (relay == null)
|
||||
{
|
||||
relay = targetButton.gameObject.AddComponent<btmandtopCurrencyHoverRelay>();
|
||||
}
|
||||
|
||||
relay.Initialize(this, isFragmentButton);
|
||||
}
|
||||
|
||||
internal void SetCurrencyHoverVisible(bool isFragmentGroup, bool visible)
|
||||
{
|
||||
CanvasGroup targetGroup = isFragmentGroup ? mmrFragmentHoverCanvasGroup : coinsHoverCanvasGroup;
|
||||
if (targetGroup == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Tween currentTween = isFragmentGroup ? mmrFragmentHoverTween : coinsHoverTween;
|
||||
if (currentTween != null && currentTween.IsActive())
|
||||
{
|
||||
currentTween.Kill();
|
||||
}
|
||||
|
||||
float duration = Mathf.Max(0.01f, currencyHoverFadeDuration);
|
||||
targetGroup.interactable = false;
|
||||
targetGroup.blocksRaycasts = false;
|
||||
|
||||
Tween nextTween = targetGroup
|
||||
.DOFade(visible ? 1f : 0f, duration)
|
||||
.SetEase(Ease.Linear)
|
||||
.SetUpdate(true)
|
||||
.SetLink(targetGroup.gameObject)
|
||||
.OnComplete(() =>
|
||||
{
|
||||
targetGroup.alpha = visible ? 1f : 0f;
|
||||
targetGroup.interactable = false;
|
||||
targetGroup.blocksRaycasts = false;
|
||||
});
|
||||
|
||||
if (isFragmentGroup)
|
||||
{
|
||||
mmrFragmentHoverTween = nextTween;
|
||||
}
|
||||
else
|
||||
{
|
||||
coinsHoverTween = nextTween;
|
||||
}
|
||||
}
|
||||
|
||||
private void KillCurrencyHoverTweens()
|
||||
{
|
||||
if (mmrFragmentHoverTween != null && mmrFragmentHoverTween.IsActive())
|
||||
{
|
||||
mmrFragmentHoverTween.Kill();
|
||||
}
|
||||
|
||||
if (coinsHoverTween != null && coinsHoverTween.IsActive())
|
||||
{
|
||||
coinsHoverTween.Kill();
|
||||
}
|
||||
|
||||
if (mmrFragmentHoverCanvasGroup != null)
|
||||
{
|
||||
mmrFragmentHoverCanvasGroup.DOKill();
|
||||
}
|
||||
|
||||
if (coinsHoverCanvasGroup != null)
|
||||
{
|
||||
coinsHoverCanvasGroup.DOKill();
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleCoinsChanged(int coinAmount)
|
||||
{
|
||||
UpdatePlayerCoinsLegacyText(coinAmount);
|
||||
@@ -1580,6 +1694,12 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
|
||||
public void UpdateSteamUserInfo()
|
||||
{
|
||||
#if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX)
|
||||
// 非 Steam 平台(如 Android):无 Steamworks,显示未知来源即可。
|
||||
if (steamStatusText != null)
|
||||
steamStatusText.text = LocalizationService.Get("steam.status.unknown", "Unknown Server");
|
||||
return;
|
||||
#else
|
||||
if (!SteamManager.Initialized)
|
||||
{
|
||||
Debug.LogWarning("[Steam] SteamManager not initialized.");
|
||||
@@ -1648,6 +1768,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
if (steamStatusText != null)
|
||||
steamStatusText.text = LocalizationService.Get("steam.status.unknown", "Unknown Server");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1678,3 +1799,39 @@ internal sealed class btmandtopPanelVisibilityRelay : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class btmandtopCurrencyHoverRelay : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler
|
||||
{
|
||||
private btmandtopController owner;
|
||||
private bool isFragmentGroup;
|
||||
|
||||
public void Initialize(btmandtopController controller, bool fragmentGroup)
|
||||
{
|
||||
owner = controller;
|
||||
isFragmentGroup = fragmentGroup;
|
||||
}
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
if (owner != null)
|
||||
{
|
||||
owner.SetCurrencyHoverVisible(isFragmentGroup, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
if (owner != null)
|
||||
{
|
||||
owner.SetCurrencyHoverVisible(isFragmentGroup, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
if (owner != null)
|
||||
{
|
||||
owner.SetCurrencyHoverVisible(isFragmentGroup, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,17 +122,13 @@ public class PauseManager : MonoBehaviour
|
||||
{
|
||||
Pause(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Pause(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Keep existing Backspace quick-exit while paused.
|
||||
if (IsPaused && Input.GetKeyDown(KeyCode.Backspace))
|
||||
{
|
||||
Pause(false);
|
||||
ResumeImmediately(true);
|
||||
StartCoroutine(LoadSceneAsync("Main_main"));
|
||||
}
|
||||
}
|
||||
@@ -144,6 +140,7 @@ public class PauseManager : MonoBehaviour
|
||||
if (IsPaused) return;
|
||||
IsPaused = true;
|
||||
Time.timeScale = 0f;
|
||||
GameplayClock.Pause();
|
||||
OnPauseStateChanged?.Invoke(true);
|
||||
|
||||
// Startup flows call Pause(true) before real gameplay starts.
|
||||
@@ -192,11 +189,38 @@ public class PauseManager : MonoBehaviour
|
||||
if (!IsPaused) return;
|
||||
IsPaused = false;
|
||||
Time.timeScale = 1f;
|
||||
GameplayClock.Resume();
|
||||
OnPauseStateChanged?.Invoke(false);
|
||||
ShowOverlayAnimated(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void ResumeImmediately(bool hideOverlay)
|
||||
{
|
||||
if (!IsPaused)
|
||||
{
|
||||
if (hideOverlay)
|
||||
{
|
||||
SetOverlayVisibleImmediate(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
IsPaused = false;
|
||||
Time.timeScale = 1f;
|
||||
GameplayClock.Resume();
|
||||
OnPauseStateChanged?.Invoke(false);
|
||||
|
||||
if (hideOverlay)
|
||||
{
|
||||
SetOverlayVisibleImmediate(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowOverlayAnimated(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void TogglePause()
|
||||
{
|
||||
if (!CanPauseFromInput()) return;
|
||||
@@ -424,7 +448,11 @@ public class PauseManager : MonoBehaviour
|
||||
EnsureOverlayCanvasGroup();
|
||||
EnsureOverlayPanelRoot();
|
||||
|
||||
overlayRoot.SetActive(visible);
|
||||
// Keep the overlay hierarchy active even when hidden.
|
||||
// If PauseManager lives on overlayRoot or any of its children, deactivating the root
|
||||
// disables this component and all future ESC input stops working.
|
||||
if (!overlayRoot.activeSelf)
|
||||
overlayRoot.SetActive(true);
|
||||
if (overlayCanvasGroup != null)
|
||||
{
|
||||
overlayCanvasGroup.alpha = visible ? 1f : 0f;
|
||||
@@ -530,8 +558,8 @@ public class PauseManager : MonoBehaviour
|
||||
if (overlayPanelRoot != null)
|
||||
overlayPanelRoot.localScale = targetScale;
|
||||
|
||||
if (!show)
|
||||
overlayRoot.SetActive(false);
|
||||
// Do not deactivate overlayRoot here; hiding via CanvasGroup is enough and keeps
|
||||
// PauseManager alive for subsequent ESC presses.
|
||||
|
||||
overlayFadeCoroutine = null;
|
||||
}
|
||||
@@ -571,16 +599,13 @@ public class PauseManager : MonoBehaviour
|
||||
}
|
||||
|
||||
// Resume chart + music.
|
||||
Pause(false);
|
||||
ResumeImmediately(false);
|
||||
continueCoroutine = null;
|
||||
}
|
||||
|
||||
private IEnumerator ReplayFromPauseCoroutine()
|
||||
{
|
||||
SetOverlayVisibleImmediate(false);
|
||||
IsPaused = false;
|
||||
Time.timeScale = 1f;
|
||||
try { OnPauseStateChanged?.Invoke(false); } catch { }
|
||||
ResumeImmediately(true);
|
||||
|
||||
var bmm = SceneObjectLookupCache.FindAny<BeatmapManager>();
|
||||
if (bmm != null && bmm.assignedSongData != null)
|
||||
@@ -596,10 +621,7 @@ public class PauseManager : MonoBehaviour
|
||||
|
||||
private IEnumerator ExitFromPauseCoroutine()
|
||||
{
|
||||
SetOverlayVisibleImmediate(false);
|
||||
IsPaused = false;
|
||||
Time.timeScale = 1f;
|
||||
try { OnPauseStateChanged?.Invoke(false); } catch { }
|
||||
ResumeImmediately(true);
|
||||
|
||||
string targetScene = ExitSceneName;
|
||||
ArenaRoomService arenaRoomService = ArenaRoomService.Instance;
|
||||
|
||||
Reference in New Issue
Block a user