改动与优化

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
+1 -1
View File
@@ -1476,7 +1476,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -413.0012, y: -70.99978}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1225836703710798441
@@ -878,6 +878,7 @@ public class globalChatSystem : MonoBehaviour
for (int i = prefix; i < desiredKeys.Count - suffix; i++)
{
GameObject instance = CreateFeedObject(visibleEntries[i]);
UI_OrderedEntryAnimator.PlaySingle(instance, i - prefix, 0.18f, 0.012f, -14f, 0.98f, true);
_renderedObjects.Insert(i, instance);
_renderedKeys.Insert(i, desiredKeys[i]);
RegisterLayoutDirtyRoot(instance);
@@ -363,7 +363,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, y: 125.23433}
m_AnchoredPosition: {x: 0, y: 62.501953}
m_SizeDelta: {x: 40, y: 40}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &225269693782171328
@@ -533,7 +533,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 3840, y: -125.234314}
m_AnchoredPosition: {x: 3840, y: -62.501953}
m_SizeDelta: {x: 256, y: 0}
m_Pivot: {x: 1, y: 0.5}
--- !u!114 &5490276556566493605
@@ -616,7 +616,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -143.99913}
m_SizeDelta: {x: 0, y: 125.23433}
m_SizeDelta: {x: 0, y: 62.501953}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &6728628998878729785
MonoBehaviour:
@@ -691,7 +691,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: 125.23433
m_PreferredHeight: 62.501953
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 2
+27 -1
View File
@@ -16,8 +16,15 @@ public class roomAsk : MonoBehaviour
private Func<Task> _onCreate;
private Func<string, Task> _onJoin;
private void Awake()
{
EnsurePopupTween();
}
public void Bind(Func<Task> onCreate, Func<string, Task> onJoin)
{
EnsurePopupTween();
_onCreate = onCreate;
_onJoin = onJoin;
@@ -132,6 +139,25 @@ public class roomAsk : MonoBehaviour
private void HandleQuitChoiceClicked()
{
Destroy(gameObject);
CloseSelfWithExitAnim();
}
private void CloseSelfWithExitAnim()
{
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
Destroy(gameObject);
}
});
}
private void EnsurePopupTween()
{
if (GetComponent<UI_PanelPopupTween>() == null)
{
gameObject.AddComponent<UI_PanelPopupTween>();
}
}
}
+63 -11
View File
@@ -91,12 +91,18 @@ public class roomDetails : MonoBehaviour
private Coroutine _songLibraryWaitRoutine;
private bool _suppressSongDropdownEvents;
private bool _isChangingRoomSong;
private bool _isClosingSelf;
private const float ChatSendCooldownSeconds = 3f;
private const int InitialHistoryLoadLimit = 20;
private const int MaxDisplayWindowLimit = 20;
private const string CooldownPlaceholderFormat = "\u53d1\u9001\u51b7\u5374\u4e2d {0}s";
private void Awake()
{
EnsurePopupTween();
}
public void ConfigureRoomRanking(GameObject roomRankingPrefab, Transform roomRankingSpawnParent)
{
_roomRankingPrefabTemplate = roomRankingPrefab;
@@ -105,6 +111,8 @@ public class roomDetails : MonoBehaviour
public void Bind(ArenaRoomService service)
{
EnsurePopupTween();
_service = service;
UIBackStack.RegisterOrBump(
@@ -114,13 +122,11 @@ public class roomDetails : MonoBehaviour
{
if (_spawnedRoomRankingInstance != null)
{
UIBackStack.Unregister(_spawnedRoomRankingInstance);
Destroy(_spawnedRoomRankingInstance);
_spawnedRoomRankingInstance = null;
CloseRoomRankingWithExitAnim();
return true;
}
Destroy(gameObject);
CloseSelfWithExitAnim();
return true;
});
@@ -311,7 +317,7 @@ public class roomDetails : MonoBehaviour
{
if (snapshot == null)
{
Destroy(gameObject);
CloseSelfWithExitAnim();
return;
}
@@ -320,12 +326,12 @@ public class roomDetails : MonoBehaviour
private void HandleKicked(string kickedSteamId, string bySteamId)
{
Destroy(gameObject);
CloseSelfWithExitAnim();
}
private void HandleRoomDismissed(string roomCode, string bySteamId)
{
Destroy(gameObject);
CloseSelfWithExitAnim();
}
private void HandleRoomChatMessagesChanged(IReadOnlyList<ArenaRoomChatMessage> messages)
@@ -374,7 +380,7 @@ public class roomDetails : MonoBehaviour
{
if (_service == null)
{
Destroy(gameObject);
CloseSelfWithExitAnim();
return;
}
@@ -397,7 +403,7 @@ public class roomDetails : MonoBehaviour
}
finally
{
Destroy(gameObject);
CloseSelfWithExitAnim();
}
}
@@ -476,6 +482,7 @@ public class roomDetails : MonoBehaviour
{
ArenaRoomParticipant participant = snapshot.participants[i];
GameObject item = Instantiate(roommatePrefab, roommateParent);
UI_OrderedEntryAnimator.PlayFadeOnly(item, i, 0.16f, 0.012f, true);
roomPrefab itemController = item.GetComponent<roomPrefab>();
if (itemController == null)
{
@@ -784,6 +791,7 @@ public class roomDetails : MonoBehaviour
systemController.Bind(systemEntry.richText);
}
UI_OrderedEntryAnimator.PlayFadeOnly(systemInstance, Mathf.Max(0, messageParent.childCount - 1), 0.14f, 0.01f, true);
return systemInstance;
}
@@ -809,6 +817,7 @@ public class roomDetails : MonoBehaviour
controller.Bind(senderSteamId, avatarUrl, displayName, title, message.content, bubbleColor);
}
UI_OrderedEntryAnimator.PlayFadeOnly(instance, Mathf.Max(0, messageParent.childCount - 1), 0.14f, 0.01f, true);
return instance;
}
@@ -1260,8 +1269,7 @@ public class roomDetails : MonoBehaviour
{
if (_spawnedRoomRankingInstance != null)
{
Destroy(_spawnedRoomRankingInstance);
_spawnedRoomRankingInstance = null;
CloseRoomRankingWithExitAnim();
}
return true;
@@ -1284,6 +1292,50 @@ public class roomDetails : MonoBehaviour
localSteamId);
}
private void CloseSelfWithExitAnim()
{
if (_isClosingSelf)
{
return;
}
_isClosingSelf = true;
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
Destroy(gameObject);
}
});
}
private void CloseRoomRankingWithExitAnim()
{
GameObject rankingInstance = _spawnedRoomRankingInstance;
if (rankingInstance == null)
{
return;
}
UIBackStack.Unregister(rankingInstance);
_spawnedRoomRankingInstance = null;
UI_PanelExitUtility.PlayExitThen(rankingInstance, () =>
{
if (rankingInstance != null)
{
Destroy(rankingInstance);
}
});
}
private void EnsurePopupTween()
{
if (GetComponent<UI_PanelPopupTween>() == null)
{
gameObject.AddComponent<UI_PanelPopupTween>();
}
}
private void UpdateQuitButtonTexts(ArenaRoomSnapshot snapshot)
{
string localSteamId = NetworkManager.Instance != null ? NetworkManager.Instance.SteamId : string.Empty;
+6 -2
View File
@@ -6842,7 +6842,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6249172551117239467, guid: 6ad36126be99a574285929280ea8fac7, type: 3}
propertyPath: m_AnchoredPosition.y
value: -120.500015
value: -120.5
objectReference: {fileID: 0}
- target: {fileID: 6249172551117239467, guid: 6ad36126be99a574285929280ea8fac7, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@@ -7026,7 +7026,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 423933864671952839, guid: f3c648c5e98a3d64fb64514c03aaf7a3, type: 3}
propertyPath: m_AnchoredPosition.x
value: 121
value: 0
objectReference: {fileID: 0}
- target: {fileID: 423933864671952839, guid: f3c648c5e98a3d64fb64514c03aaf7a3, type: 3}
propertyPath: m_AnchoredPosition.y
@@ -7232,6 +7232,10 @@ PrefabInstance:
propertyPath: m_SizeDelta.x
value: 116
objectReference: {fileID: 0}
- target: {fileID: 8469056815856914825, guid: f3c648c5e98a3d64fb64514c03aaf7a3, type: 3}
propertyPath: m_AnchoredPosition.x
value: 118
objectReference: {fileID: 0}
- target: {fileID: 8469056815856914825, guid: f3c648c5e98a3d64fb64514c03aaf7a3, type: 3}
propertyPath: m_AnchoredPosition.y
value: -2