UI HUGE UPDATE
This commit is contained in:
@@ -1531,7 +1531,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
@@ -1623,8 +1623,8 @@ MonoBehaviour:
|
||||
entry:
|
||||
path: MusicPic
|
||||
text: "\u8FD9\u4E9B\u662F\u6211\u4ECE\u623F\u95F4\u91CC\u641C\u96C6\u6765\u7684\uFF0C\u60A8\u6311\u4E24\u9996\uFF1F\u4E0D\u5FC5\u5728\u610F\u6211\u5BF9\u60A8\u54C1\u5473\u7684\u770B\u6CD5\u3002\u4E0D\u8FC7\u5728\u67D0\u4E9B\u60C5\u51B5\u4E0B...\u6211\u662F\u4F1A\u5207\u6389\u7684\u54E6\u3002"
|
||||
iconPath: "Assets/artworks/Ul_Ul/\u65B0\u7248\u4E3B\u754C\u9762\uFF082\uFF09/\u97F3\u4E50"
|
||||
icon: {fileID: 7605814977653748970, guid: fd7da29c38f47ea4695ec23268ebdd9d, type: 3}
|
||||
iconPath: Assets/__ui_new/hallway/ui_icon_maininterface_lowebar_music.png
|
||||
icon: {fileID: 21300000, guid: e43a4710f4f3c4846a18d85cb4a109b5, type: 3}
|
||||
--- !u!1 &1207165874131126891
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2659,7 +2659,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
@@ -5821,7 +5821,7 @@ Canvas:
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 1235
|
||||
m_SortingOrder: 1233
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &5224241407313794548
|
||||
MonoBehaviour:
|
||||
@@ -8279,7 +8279,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0.5499878, y: 4.5996094}
|
||||
m_AnchoredPosition: {x: 0.54992676, y: 4.5996094}
|
||||
m_SizeDelta: {x: 0, y: 52.4}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!114 &2708908290101177617
|
||||
@@ -9836,7 +9836,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
@@ -10734,7 +10734,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
|
||||
@@ -129,6 +129,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
private readonly Dictionary<string, int> guideIndexByScene = new Dictionary<string, int>();
|
||||
private string currentGuideScene = string.Empty;
|
||||
private static btmandtopController activeInstance;
|
||||
private RectTransform topNavigationRoot;
|
||||
|
||||
private static readonly List<string> sceneHistory = new List<string>();
|
||||
private static bool sceneHistoryHooked = false;
|
||||
@@ -201,6 +202,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
closeGuideButton.onClick.AddListener(CloseGuideDisplay);
|
||||
|
||||
BindNewBackButtons();
|
||||
EnsureTopNavigationFront();
|
||||
|
||||
EnsureMusicPicRoot();
|
||||
SetupMusicPicDefault();
|
||||
@@ -333,6 +335,8 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
CurrentOverlayPanelsVisible = overlayVisible;
|
||||
GlobalOverlayPanelVisibilityChanged?.Invoke(overlayVisible);
|
||||
}
|
||||
|
||||
EnsureTopNavigationFront();
|
||||
}
|
||||
|
||||
|
||||
@@ -887,6 +891,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
BroadcastOverlayPanelsVisibility();
|
||||
}
|
||||
});
|
||||
EnsureTopNavigationFront();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -905,6 +910,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
});
|
||||
}
|
||||
BroadcastOverlayPanelsVisibility();
|
||||
EnsureTopNavigationFront();
|
||||
}
|
||||
|
||||
private void BroadcastSettingsVisibility(bool visible)
|
||||
@@ -931,6 +937,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
private bool AreOverlayPanelsVisible()
|
||||
{
|
||||
return (settingsInstance != null && settingsInstance.activeInHierarchy)
|
||||
|| (userInfoInstance != null && userInfoInstance.activeInHierarchy)
|
||||
|| (storeInstance != null && storeInstance.activeInHierarchy)
|
||||
|| (showLevelInstance != null && showLevelInstance.activeInHierarchy)
|
||||
|| (emailInstance != null && emailInstance.activeInHierarchy)
|
||||
@@ -944,6 +951,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
lastOverlayPanelsVisibilityState = visible;
|
||||
CurrentOverlayPanelsVisible = visible;
|
||||
GlobalOverlayPanelVisibilityChanged?.Invoke(visible);
|
||||
EnsureTopNavigationFront();
|
||||
}
|
||||
|
||||
private void RegisterManagedPanel(GameObject panel, System.Action closeAction)
|
||||
@@ -1091,6 +1099,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
|
||||
PlacePanelBelowSettings(instance);
|
||||
BroadcastOverlayPanelsVisibility();
|
||||
EnsureTopNavigationFront();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1237,10 +1246,18 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
settings_navButton.onClick.RemoveListener(navSettingsAction);
|
||||
settings_navButton.onClick.AddListener(navSettingsAction);
|
||||
}
|
||||
|
||||
EnsureTopNavigationFront();
|
||||
}
|
||||
|
||||
private void ResolveNewBackButtons()
|
||||
{
|
||||
Transform topRoot = FindChildRecursive(transform, "TOP");
|
||||
if (topRoot != null)
|
||||
{
|
||||
topNavigationRoot = topRoot as RectTransform;
|
||||
}
|
||||
|
||||
Transform navRoot = FindChildRecursive(transform, "New back");
|
||||
if (navRoot == null)
|
||||
{
|
||||
@@ -1257,6 +1274,89 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
|
||||
settings_navButton = FindButtonByName(navRoot, "settings");
|
||||
}
|
||||
|
||||
private void EnsureTopNavigationFront()
|
||||
{
|
||||
ResolveTopNavigationRoot();
|
||||
|
||||
if (topNavigationRoot == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Transform parent = topNavigationRoot.parent;
|
||||
if (parent == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (topNavigationRoot.GetSiblingIndex() != parent.childCount - 1)
|
||||
{
|
||||
topNavigationRoot.SetAsLastSibling();
|
||||
}
|
||||
|
||||
RefreshTopNavigationGeometry();
|
||||
}
|
||||
|
||||
private void ResolveTopNavigationRoot()
|
||||
{
|
||||
if (topNavigationRoot != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Transform topRoot = FindChildRecursive(transform, "TOP");
|
||||
if (topRoot == null)
|
||||
{
|
||||
GameObject sceneTop = FindByName("TOP");
|
||||
if (sceneTop != null)
|
||||
{
|
||||
topRoot = sceneTop.transform;
|
||||
}
|
||||
}
|
||||
|
||||
if (topRoot != null)
|
||||
{
|
||||
topNavigationRoot = topRoot as RectTransform;
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshTopNavigationGeometry()
|
||||
{
|
||||
if (topNavigationRoot == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Canvas.ForceUpdateCanvases();
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(topNavigationRoot);
|
||||
|
||||
RectTransform navRoot = null;
|
||||
if (back_navButton != null)
|
||||
{
|
||||
navRoot = back_navButton.transform.parent as RectTransform;
|
||||
}
|
||||
if (navRoot == null)
|
||||
{
|
||||
Transform candidate = FindChildRecursive(topNavigationRoot, "New back");
|
||||
navRoot = candidate as RectTransform;
|
||||
}
|
||||
if (navRoot != null)
|
||||
{
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(navRoot);
|
||||
}
|
||||
|
||||
if (back_navButton != null)
|
||||
{
|
||||
RectTransform backRect = back_navButton.transform as RectTransform;
|
||||
if (backRect != null)
|
||||
{
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(backRect);
|
||||
}
|
||||
}
|
||||
|
||||
Canvas.ForceUpdateCanvases();
|
||||
}
|
||||
|
||||
private static Transform FindChildRecursive(Transform root, string childName)
|
||||
{
|
||||
if (root == null || string.IsNullOrEmpty(childName)) return null;
|
||||
|
||||
Reference in New Issue
Block a user