fix: chat PlayerName fallback + nouveau build WebGL 20260517b

- ChatUI: PlayerName utilise PlayerPrefs comme fallback si non connecte
- NetworkManager: sauvegarde le nom dans PlayerPrefs a la connexion
- GameCanvas: version build bump -> 20260517b (cache bust)
- Nouveaux fichiers build_mai (data + wasm mis a jour)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-17 20:21:00 +02:00
parent e0da6c4f00
commit b993c6b3e6
9 changed files with 26 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@ import { useState, useEffect, useCallback } from 'react'
// Check if Unity build files exist
const UNITY_BUILD_PATH = '/unity-build/Build'
// Cache-busting version — update this after each Unity build
const UNITY_BUILD_VERSION = '20260517'
const UNITY_BUILD_VERSION = '20260517b'
const BUILD_PREFIX = 'build_mai'
const LOADER_URL = `${UNITY_BUILD_PATH}/${BUILD_PREFIX}.loader.js?v=${UNITY_BUILD_VERSION}`

View File

@@ -113,6 +113,7 @@ public class NetworkManager : MonoBehaviour
LastError = "";
LocalPlayerName = playerName;
LocalPlayerColor = color;
PlayerPrefs.SetString("rolld_player_name", playerName);
try
{

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e9c4c0760bb30024293b8152d79c595e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f63c62c1f3656c644947907edfe2e07f

View File

@@ -135,6 +135,8 @@ public class ChatUI : MonoBehaviour
_inputText = GUILayout.TextField(_inputText, 200, ImGuiSkin.TextField, GUILayout.Height(28f));
bool canSend = !string.IsNullOrWhiteSpace(_inputText) && PlayerName.Length > 0;
if (PlayerName.Length == 0)
GUILayout.Label("Connectez-vous au jeu pour envoyer des messages.", ImGuiSkin.LabelDim);
GUI.enabled = canSend;
if (GUILayout.Button("Envoyer", ImGuiSkin.Button, GUILayout.Width(80f), GUILayout.Height(28f)))
TrySend();
@@ -171,7 +173,15 @@ public class ChatUI : MonoBehaviour
// ─── Send ────────────────────────────────────────────────────────────
private string PlayerName => NetworkManager.Instance?.LocalPlayerName ?? "";
private string PlayerName
{
get
{
var nm = NetworkManager.Instance?.LocalPlayerName;
if (!string.IsNullOrEmpty(nm)) return nm;
return PlayerPrefs.GetString("rolld_player_name", "");
}
}
private void TrySend()
{

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: baad3cbcb6161a548ba18d5272ba57c5