#UI didn't show up
1 messages · Page 1 of 1 (latest)
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
And now?
i see the files now, but you should still use the paste sites above
in scene view when i click play and manually enable this panel it normally shows,but after one player win in log I have this
🟢 WinPanel został aktywowany.
UnityEngine.Debug:Log (object)
WinPanel:ShowWinner (string) (at Assets/Script/Game/WinPanel.cs:35)
PlayerInfo:HandleServerMessage (string) (at Assets/Script/Player/PlayerInfo.cs:248)
PlayerInfo:<InitializeConnection>b__24_1 (byte[]) (at Assets/Script/Player/PlayerInfo.cs:94)
NativeWebSocket.WebSocket:DispatchMessageQueue () (at Assets/Plugins/NativeWebSocket/WebSocket.cs:637)
PlayerInfo:Update () (at Assets/Script/Player/PlayerInfo.cs:396)
WinPanel został aktywowany. means WinPanel is activated
in that case with someone winning normally, do you see the panel in scene view?
perhaps check if anything along the hierarchy is deactivated
is it.. not that?
this is it, but when i play this game it won't show
ah, i thought you were in play mode
do you see the winpanel in scene view while in play mode
is disabled,but code should enabled it after player win
you have here
private void Awake()
{
Debug.Log("✅ WinPanel.Awake – WinPanel obecny w scenie");
gameObject.SetActive(false); // Ukryj cały panel
}
that on start the panel shall be not active
and here is activated
public void ShowWinner(string nickname)
{
Debug.Log($"[WIN PANEL] ShowWinner wywołane dla: {nickname}");
if (winnerText != null)
{
winnerText.text = $"{nickname} Wins!";
}
else
{
Debug.LogWarning("⚠️ winnerText nie jest przypisany.");
}
gameObject.SetActive(true); // Pokaż cały panel
Debug.Log("🟢 WinPanel został aktywowany.");
in addition my uimanager is singleton in the first scene, I made prefab from winpanel object and add to the uimanager
could you add this as context to that last log, the 'został aktywowany' one
like Debug.Log("...", this);
to make sure it's on the right object
that's not what i said to do
pass it as another argument
then you can click (or double-click, i don't remember) the log to highlight the object it came from
when i double cilcked it opens vs and shows this code
public void ShowWinner(string nickname)
{
Debug.Log($"[WIN PANEL] ShowWinner wywołane dla: {nickname}");
if (winnerText != null)
{
winnerText.text = $"{nickname} Wins!";
}
else
{
Debug.LogWarning("⚠️ winnerText nie jest przypisany.");
}
gameObject.SetActive(true); // Pokaż cały panel
Debug.Log("🟢 WinPanel został aktywowany.this");
yeah because you haven't actually set the context
gameObject.SetActive(true); // Pokaż cały panel
Debug.Log("🟢 WinPanel został aktywowany.",this);
like this?
yes
i add it
in logs you have who is the winner and that panel is activated
📥 HandleServerMessage RAW: {"type":"game_over","winner":"test2"}
UnityEngine.Debug:Log (object)
PlayerInfo:HandleServerMessage (string) (at Assets/Script/Player/PlayerInfo.cs:147)
PlayerInfo:<InitializeConnection>b__24_1 (byte[]) (at Assets/Script/Player/PlayerInfo.cs:94)
NativeWebSocket.WebSocket:DispatchMessageQueue () (at Assets/Plugins/NativeWebSocket/WebSocket.cs:637)
PlayerInfo:Update () (at Assets/Script/Player/PlayerInfo.cs:396)
🎉 Zwycięzca meczu: test2
UnityEngine.Debug:Log (object)
PlayerInfo:HandleServerMessage (string) (at Assets/Script/Player/PlayerInfo.cs:247)
PlayerInfo:<InitializeConnection>b__24_1 (byte[]) (at Assets/Script/Player/PlayerInfo.cs:94)
NativeWebSocket.WebSocket:DispatchMessageQueue () (at Assets/Plugins/NativeWebSocket/WebSocket.cs:637)
PlayerInfo:Update () (at Assets/Script/Player/PlayerInfo.cs:396)
[WIN PANEL] ShowWinner wywołane dla: test2
UnityEngine.Debug:Log (object)
WinPanel:ShowWinner (string) (at Assets/Script/Game/WinPanel.cs:23)
PlayerInfo:HandleServerMessage (string) (at Assets/Script/Player/PlayerInfo.cs:248)
PlayerInfo:<InitializeConnection>b__24_1 (byte[]) (at Assets/Script/Player/PlayerInfo.cs:94)
NativeWebSocket.WebSocket:DispatchMessageQueue () (at Assets/Plugins/NativeWebSocket/WebSocket.cs:637)
PlayerInfo:Update () (at Assets/Script/Player/PlayerInfo.cs:396)
click on the 'został aktywowany' log and see what gameobject it's coming from