客户端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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user