Turn MatchHud into a uGUI canvas binder
Replace the runtime IMGUI (OnGUI) HUD with a binder that drives the authored MatchHudCanvas widgets via [SerializeField] references (Canvas / Phase / Time / Crosshair). Visibility toggles Canvas.enabled instead of the GameObject, so Update keeps polling while hidden; an Awake guard disables the component on unwired references. Drop the AddComponent<MatchHud>() bootstrap in MatchManager - the component now lives on the scene canvas. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
fbbb4f7419
commit
8f9b6cf1bc
2 files changed
+51
-65
No files matched your search
@@ -212,9 +212,6 @@ public class MatchManager : MonoBehaviour
|
||||
_playerPrefab = _net.NetworkConfig.PlayerPrefab;
|
||||
_net.NetworkConfig.PlayerPrefab = null;
|
||||
}
|
||||
|
||||
// Placeholder on-screen match HUD, added at runtime so it needs no scene/prefab authoring.
|
||||
if (!GetComponent<MatchHud>()) gameObject.AddComponent<MatchHud>();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
|
||||
Reference in new issue
Block a user