Refactor Assets/Scripts: trim restating comments, minor structure cleanups
Sweep over 48 files (Editor/ excluded): remove comments that restate the code, condense class summaries, fix three stale doc statements (HsvColorPicker alpha bar, PaintHud layoutPrefab, MasterVolume FallbackDefault). Inline two single-use wrappers (IsPointerOverUi, BuildModes), drop an unused using, replace a magic literal with the existing ParallaxBase constant, and convert ~10 UnityEngine.Object null checks to the implicit-bool convention. No serialized fields, signatures, RPC/NetworkVariable names, defaults, or #if blocks touched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
eeee5fc2f0
commit
6c03e5d3f6
48 files changed
+289
-481
No files matched your search
@@ -9,25 +9,17 @@ using Unity.Services.Multiplayer;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Online hosting/joining over Unity Gaming Services so players can connect across the internet
|
||||
/// without port forwarding. Uses the unified Multiplayer Services "Sessions" API, which bundles
|
||||
/// Relay (NAT-free messaging via Unity's relay servers) + Lobby (the public server list) + anonymous
|
||||
/// Authentication behind single calls, and configures + starts the NGO transport itself - so we do
|
||||
/// NOT call <see cref="NetworkManager.StartHost"/>/<c>StartClient</c> here; CreateSessionAsync starts
|
||||
/// the host and JoinSession* starts the client.
|
||||
/// Online hosting/joining over Unity Gaming Services (unified Multiplayer "Sessions" API: Relay + Lobby +
|
||||
/// anonymous Authentication behind single calls). The Sessions API configures and starts the NGO transport
|
||||
/// itself, so we do NOT call <see cref="NetworkManager.StartHost"/>/<c>StartClient</c> here -
|
||||
/// CreateSessionAsync starts the host, JoinSession* starts the client; the usual NetworkManager callbacks
|
||||
/// then fire exactly as for loopback hosting, so MatchManager, spawning and authority are unaffected.
|
||||
/// Note the UGS "session" (the public server-list entry) is distinct from the in-game "Lobby" scene.
|
||||
///
|
||||
/// Terminology: the UGS "session" is the entry in the public server list (network layer). It is a
|
||||
/// different thing from the in-game "Lobby" scene (the pre-match staging area that <see cref="MatchManager"/>
|
||||
/// loads after the connection is up). This component does not touch the match flow at all - the usual
|
||||
/// NetworkManager callbacks fire exactly as they do for loopback hosting, so MatchManager, spawning and
|
||||
/// authority are unaffected.
|
||||
///
|
||||
/// This is the logic layer only: state + async host/refresh/join/disconnect calls, surfaced through the
|
||||
/// <see cref="Changed"/>/<see cref="SessionsChanged"/> events. The uGUI server browser that drives it lives
|
||||
/// on its own canvas (<see cref="OnlineSessionBrowserUI"/>); this component carries no UI of its own.
|
||||
/// Requires the project to be linked to a UGS cloud project (Project Settings > Services) with Relay,
|
||||
/// Lobby and Authentication (Anonymous) enabled; otherwise sign-in fails with a clear status message.
|
||||
/// Attach to the same GameObject as the NetworkManager.
|
||||
/// Logic layer only, surfaced through the <see cref="Changed"/>/<see cref="SessionsChanged"/> events; the
|
||||
/// uGUI browser driving it is <see cref="OnlineSessionBrowserUI"/>. Requires the project to be linked to a
|
||||
/// UGS cloud project (Project Settings > Services) with Relay, Lobby and Authentication (Anonymous)
|
||||
/// enabled; otherwise sign-in fails with a clear status message.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(NetworkManager))]
|
||||
[DisallowMultipleComponent]
|
||||
@@ -122,7 +114,7 @@ public class OnlineSessionManager : MonoBehaviour
|
||||
Changed?.Invoke();
|
||||
}
|
||||
|
||||
private async System.Threading.Tasks.Task EnsureSignedInAsync()
|
||||
private async Task EnsureSignedInAsync()
|
||||
{
|
||||
if (UnityServices.State != ServicesInitializationState.Initialized)
|
||||
{
|
||||
@@ -156,7 +148,7 @@ public class OnlineSessionManager : MonoBehaviour
|
||||
// Shared busy/sign-in/error skeleton around one session operation; the body carries the
|
||||
// op-specific statuses and state. ownsConnection = the op starts NGO (host/join), so a timeout that
|
||||
// left the transport half-up must tear it down.
|
||||
private async System.Threading.Tasks.Task RunSessionOpAsync(string failLabel, bool ownsConnection, Func<System.Threading.Tasks.Task> body)
|
||||
private async Task RunSessionOpAsync(string failLabel, bool ownsConnection, Func<Task> body)
|
||||
{
|
||||
SetBusy(true);
|
||||
try
|
||||
|
||||
Reference in new issue
Block a user