Nim-XD 1 týždeň pred
rodič
commit
312b563c1a

+ 3 - 35
Assets/Scripts/Mechanics/GameSystems/CheckpointSystem.cs

@@ -2,10 +2,6 @@ using UnityEngine;
 using System.Collections.Generic;
 using TMPro;
 
-/// <summary>
-/// Manages checkpoint saving and loading for the respawn system.
-/// Automatically captures player's start position as fallback respawn point.
-/// </summary>
 public class CheckpointSystem : MonoBehaviour
 {
     public static CheckpointSystem Instance { get; private set; }
@@ -34,7 +30,7 @@ public class CheckpointSystem : MonoBehaviour
     private List<SavedCharacterData> savedCharacters = new List<SavedCharacterData>();
     private bool hasCheckpoint = false;
 
-    [System.Serializable] // This class is used to save the characters data when the checkpoint is saved
+    [System.Serializable]
     private class SavedCharacterData
     {
         public CharacterInGroup character;
@@ -55,7 +51,6 @@ public class CheckpointSystem : MonoBehaviour
         }
     }
 
-    #region Initialization
 
     private void Awake()
     {
@@ -99,22 +94,14 @@ public class CheckpointSystem : MonoBehaviour
     {
         yield return new WaitForSeconds(0.5f);
         
-        // Save the starting position as initial checkpoint
         SaveCheckpoint();
-        Debug.Log("[CheckpointSystem] Initial checkpoint saved at start position");
     }
 
-    #endregion
 
-    #region Checkpoint Save
 
     public void SaveCheckpoint()
     {
-        if (playerTransform == null || cohesionManager == null)
-        {
-            Debug.LogWarning("[CheckpointSystem] Cannot save checkpoint: missing references");
-            return;
-        }
+        if (playerTransform == null || cohesionManager == null) return;
 
         savedPlayerPosition = playerTransform.position;
         
@@ -128,8 +115,6 @@ public class CheckpointSystem : MonoBehaviour
         }
         
         hasCheckpoint = true;
-        
-        Debug.Log($"[CheckpointSystem] Checkpoint saved with {savedCharacters.Count} characters");
     }
 
     public void SaveCheckpointAt(Vector3 position)
@@ -149,21 +134,13 @@ public class CheckpointSystem : MonoBehaviour
         }
         
         hasCheckpoint = true;
-        
-        Debug.Log($"[CheckpointSystem] Manual checkpoint saved at {savedPlayerPosition}");
     }
 
-    #endregion
 
-    #region Checkpoint Load
 
     public void LoadCheckpoint()
     {
-        if (!hasCheckpoint)
-        {
-            Debug.LogWarning("[CheckpointSystem] No checkpoint available");
-            return;
-        }
+        if (!hasCheckpoint) return;
 
         if (playerTransform != null)
         {
@@ -175,8 +152,6 @@ public class CheckpointSystem : MonoBehaviour
             playerMovement.currentFloorLevel = savedFloorLevel;
 
         RestoreCharacters();
-        
-        // Show respawn UI message
         ShowRespawnMessage();
     }
 
@@ -213,9 +188,7 @@ public class CheckpointSystem : MonoBehaviour
         }
     }
 
-    #endregion
 
-    #region Checkpoint Triggers
 
     private void OnTriggerEnter(Collider other)
     {
@@ -225,16 +198,12 @@ public class CheckpointSystem : MonoBehaviour
         }
     }
 
-    #endregion
 
-    #region Public API
 
     public bool HasCheckpoint() => hasCheckpoint;
     public Vector3 GetCheckpointPosition() => savedPlayerPosition;
 
-    #endregion
     
-    #region Respawn UI
     
     private void ShowRespawnMessage()
     {
@@ -275,5 +244,4 @@ public class CheckpointSystem : MonoBehaviour
         respawnText.gameObject.SetActive(false);
     }
     
-    #endregion
 }

+ 0 - 26
Assets/Scripts/Mechanics/GameSystems/CheckpointTrigger.cs

@@ -1,10 +1,6 @@
 using UnityEngine;
 using TMPro;
 
-/// <summary>
-/// Place this component on a GameObject to create a checkpoint zone.
-/// When the player enters, it will save the current game state.
-/// </summary>
 [RequireComponent(typeof(BoxCollider))]
 public class CheckpointTrigger : MonoBehaviour
 {
@@ -54,10 +50,8 @@ public class CheckpointTrigger : MonoBehaviour
 
     private void OnTriggerEnter(Collider other)
     {
-        // Check if player entered
         if (other.CompareTag("Player"))
         {
-            // If one-time use and already triggered, ignore
             if (oneTimeUse && hasBeenTriggered)
                 return;
 
@@ -65,21 +59,14 @@ public class CheckpointTrigger : MonoBehaviour
         }
     }
 
-    /// <summary>
-    /// Activate this checkpoint and save game state
-    /// </summary>
     public void ActivateCheckpoint()
     {
         CheckpointSystem checkpointSystem = CheckpointSystem.Instance;
 
         if (checkpointSystem != null)
         {
-            // Save checkpoint at this position
             checkpointSystem.SaveCheckpointAt(transform.position);
 
-            Debug.Log($"[Checkpoint] {checkpointMessage} at {transform.position}");
-
-            // Show feedback
             if (showVisualFeedback)
             {
                 ShowFeedback();
@@ -87,36 +74,27 @@ public class CheckpointTrigger : MonoBehaviour
 
             hasBeenTriggered = true;
         }
-        else
-        {
-            Debug.LogWarning("[Checkpoint] CheckpointSystem not found!");
-        }
     }
 
     private void ShowFeedback()
     {
-        // Play sound
         if (audioSource != null && checkpointSound != null)
         {
             audioSource.Play();
         }
 
-        // Spawn VFX
         if (checkpointVFX != null)
         {
             checkpointVFX.SetActive(true);
             Destroy(checkpointVFX, fadeDuration * 2 + displayDuration);
         }
         
-        // Show text with smooth fade animation
         if (checkpointText != null && textCanvasGroup != null)
         {
             checkpointText.text = checkpointMessage;
             checkpointText.gameObject.SetActive(true);
             StartCoroutine(FadeTextInOut());
         }
-
-        Debug.Log($"[Checkpoint] ✓ {checkpointMessage}");
     }
 
     private System.Collections.IEnumerator FadeTextInOut()
@@ -148,15 +126,11 @@ public class CheckpointTrigger : MonoBehaviour
         checkpointText.gameObject.SetActive(false);
     }
 
-    /// <summary>
-    /// Reset this checkpoint so it can be triggered again
-    /// </summary>
     public void ResetCheckpoint()
     {
         hasBeenTriggered = false;
     }
 
-    // Visualize checkpoint in editor
     private void OnDrawGizmos()
     {
         Gizmos.color = hasBeenTriggered ? Color.green : Color.yellow;

+ 0 - 1
Assets/Scripts/Mechanics/GameSystems/GameInitializer.cs

@@ -52,6 +52,5 @@ public class GameInitializer : MonoBehaviour
 
         cohesionManager.groupMembers = new List<CharacterInGroup> { starter };
         gridManager.characters = new List<CharacterInGroup> { starter };
-        Debug.Log("Héros initial ajouté : " + starter.characterName);
     }
 }

+ 0 - 22
Assets/Scripts/Mechanics/GameSystems/GameManager.cs

@@ -1,10 +1,6 @@
 using UnityEngine;
 using System.Collections;
 
-/// <summary>
-/// Central manager for game state, death, and respawn logic.
-/// Handles party wipe detection, death sequence, and respawn coordination.
-/// </summary>
 public class GameManager : MonoBehaviour
 {
     public static GameManager Instance { get; private set; }
@@ -27,8 +23,6 @@ public class GameManager : MonoBehaviour
     private bool isPlayerDead = false;
     private CanvasGroup fadeCanvasGroup;
 
-    #region Initialization
-
     private void Awake()
     {
         if (Instance != null && Instance != this)
@@ -66,16 +60,9 @@ public class GameManager : MonoBehaviour
     {
         bool hasAllReferences = cohesionManager != null && checkpointSystem != null && 
                                 deathScreenUI != null && playerMovement != null;
-        
-        if (!hasAllReferences)
-        {
-            Debug.LogError("[GameManager] Missing references! Respawn system may not work.");
-        }
     }
 
-    #endregion
 
-    #region Death & Respawn
 
     public void OnPartyWiped()
     {
@@ -101,7 +88,6 @@ public class GameManager : MonoBehaviour
         }
         else
         {
-            Debug.LogWarning("[GameManager] Death Screen UI not found, auto-respawning");
             RespawnParty();
         }
     }
@@ -124,7 +110,6 @@ public class GameManager : MonoBehaviour
         }
         else
         {
-            Debug.LogWarning("[GameManager] CheckpointSystem not found, basic respawn");
             BasicRespawn();
         }
         
@@ -158,9 +143,7 @@ public class GameManager : MonoBehaviour
         }
     }
 
-    #endregion
 
-    #region Monster Management
 
     private void StopAllMonsterAttacks()
     {
@@ -203,9 +186,7 @@ public class GameManager : MonoBehaviour
         // TODO: Implement gold penalty when currency system exists
     }
 
-    #endregion
 
-    #region Fade Effects
     
     private void CreateFadeOverlay()
     {
@@ -257,13 +238,10 @@ public class GameManager : MonoBehaviour
         fadeCanvasGroup.alpha = 0f;
     }
     
-    #endregion
 
-    #region Public API
 
     public bool IsPlayerDead() => isPlayerDead;
 
-    #endregion
 }
 
 

+ 0 - 11
Assets/Scripts/Mechanics/GameSystems/RecruitDialogueUI.cs

@@ -51,7 +51,6 @@ public class RecruitDialogueUI : MonoBehaviour
 {
     if (FindObjectOfType<TeamCohesionManager>().groupMembers.Count >= 5)
     {
-        Debug.LogWarning("Le groupe est complet. Impossible de recruter un nouveau personnage.");
         return;
     }
     var newChar = recruit.GenerateCharacter();
@@ -69,22 +68,14 @@ public class RecruitDialogueUI : MonoBehaviour
                 newChar.gridX = x;
                 newChar.gridY = y;
 
-                Debug.Log("Héros placé en " + newChar.gridX + "," + newChar.gridY);
-
                 team.groupMembers.Add(newChar);
 
-                // Ajout à la grille visuelle
                 PositionGridManager grid = FindObjectOfType<PositionGridManager>();
                 if (grid != null)
                 {
                     grid.AddCharacter(newChar);
                 }
-                else
-                {
-                    Debug.LogWarning("[Recruitment] Aucun PositionGridManager trouvé dans la scène.");
-                }
 
-                // Rafraîchit l'UI
                 PartyUIManager ui = FindObjectOfType<PartyUIManager>();
                 ui.DisplayPartyUI();
 
@@ -92,8 +83,6 @@ public class RecruitDialogueUI : MonoBehaviour
             }
         }
     }
-
-    Debug.Log("Pas de place libre sur la grille pour un nouveau héros !");
 }
 
 }

+ 0 - 2
Assets/Scripts/Mechanics/GroupCohesion/TeamCohesionManager.cs

@@ -56,7 +56,6 @@ public class TeamCohesionManager : MonoBehaviour
         }
 
         target.relations.Modify(from, delta);
-        Debug.Log($"{from} affecte {to} avec {action}, nouvelle relation : {target.relations.Get(from)}");
     }
 
     public void OnCharacterHurt(string hurtName)
@@ -71,7 +70,6 @@ public class TeamCohesionManager : MonoBehaviour
                 if (ally.characterType == CharacterInGroup.CharacterType.Warrior && ally.gridY > hurt.gridY)
                 {
                     ally.relations.Modify(hurt.characterName, -5f);
-                    Debug.Log($"{ally.characterName} en veut à {hurt.characterName} pour s'être mis en danger devant lui.");
                 }
             }
         }

+ 0 - 1
Assets/Scripts/Mechanics/Levier.cs

@@ -12,7 +12,6 @@ public class Levier : MonoBehaviour
         if (porteLiee != null)
         {
             porteLiee.SetActive(!estActive);
-            Debug.Log("Levier activé, porte " + (estActive ? "ouverte" : "fermée"));
         }
     }
 }

+ 0 - 1
Assets/Scripts/Monsters/CombatManager.cs

@@ -17,7 +17,6 @@ public class CombatManager : MonoBehaviour
     {
         if (!monsters.Contains(monster))
             monsters.Add(monster);
-        Debug.Log("#M01 > Monster Added" + monster);
     }
 
     void Update()

+ 0 - 7
Assets/Scripts/Monsters/MonsterAnimatorController.cs

@@ -7,28 +7,23 @@ public class MonsterAnimatorController : MonoBehaviour
     private void Awake()
     {
         animator = GetComponent<Animator>();
-        if (animator == null)
-            Debug.LogError($"[MonsterAnimatorController] Aucun Animator trouvé sur {gameObject.name}");
     }
 
     public void PlayMove()
     {
         if (animator == null) return;
-        Debug.Log($"[MonsterAnimator] {gameObject.name} → PlayMove");
         animator.SetBool("IsWalking", true);
     }
 
     public void StopMove()
     {
         if (animator == null) return;
-        Debug.Log($"[MonsterAnimator] {gameObject.name} → StopMove");
         animator.SetBool("IsWalking", false);
     }
 
     public void PlayAttack()
     {
         if (animator == null) return;
-        Debug.Log($"[MonsterAnimator] {gameObject.name} → PlayAttack");
         animator.ResetTrigger("Attack");
         animator.SetTrigger("Attack");
     }
@@ -36,7 +31,6 @@ public class MonsterAnimatorController : MonoBehaviour
     public void PlayHurt()
     {
         if (animator == null) return;
-        Debug.Log($"[MonsterAnimator] {gameObject.name} → PlayHurt");
         animator.ResetTrigger("Hurt");
         animator.SetTrigger("Hurt");
     }
@@ -44,7 +38,6 @@ public class MonsterAnimatorController : MonoBehaviour
     public void PlayDeath()
     {
         if (animator == null) return;
-        Debug.Log($"[MonsterAnimator] {gameObject.name} → PlayDeath");
         animator.ResetTrigger("Die");
         animator.SetTrigger("Die");
     }

+ 9 - 37
Assets/Scripts/Monsters/MonsterController.cs

@@ -17,14 +17,13 @@ public class MonsterController : MonoBehaviour
     public DamageNumber damagePopupPrefab;
     public GameObject goldBagPrefab;
     public Transform goldSpawnPoint;
-    public float goldDropYOffset = 0.15f; // Y offset for gold drop position
+    public float goldDropYOffset = 0.15f;
 
     private void Start()
     {
         animator = GetComponent<MonsterAnimatorController>();
         currentHP = data.maxHP;
 
-        // Start with attack ready (set timer to cooldown value)
         if (data != null)
         {
             attackTimer = data.attackCooldown;
@@ -37,20 +36,15 @@ public class MonsterController : MonoBehaviour
     {
         if (damagePopupPrefab == null) return;
 
-        // Position du popup : au-dessus du monstre
         Vector3 popupPosition = transform.position + Vector3.up * 2f;
-
-        // Spawn world-space popup (si prefab DamageNumberMesh)
         DamageNumber newPopup = damagePopupPrefab.Spawn(popupPosition, amount);
 
-        // Make damage number face the camera without mirroring
         if (newPopup != null)
         {
             Transform cameraTransform = Camera.main?.transform;
 
             if (cameraTransform != null)
             {
-                // Copy camera's rotation (billboard effect) but keep it upright
                 Vector3 cameraEuler = cameraTransform.eulerAngles;
                 newPopup.transform.rotation = Quaternion.Euler(0f, cameraEuler.y, 0f);
             }
@@ -80,19 +74,17 @@ public class MonsterController : MonoBehaviour
     public void FaceTarget(Vector3 target, bool instant = false)
     {
         Vector3 direction = (target - transform.position).normalized;
-        direction.y = 0; // rester sur le plan horizontal
+        direction.y = 0;
         if (direction != Vector3.zero)
         {
             Quaternion targetRotation = Quaternion.LookRotation(direction);
 
             if (instant)
             {
-                // Instant rotation for combat
                 transform.rotation = targetRotation;
             }
             else
             {
-                // Smooth rotation for movement
                 transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * rotationSpeed);
             }
         }
@@ -137,10 +129,8 @@ public class MonsterController : MonoBehaviour
 
     public int GetDamage()
     {
-        // Échec d'attaque ?
         if (Random.value < data.missChance)
         {
-            Debug.Log($"{gameObject.name} a raté son attaque !");
             return 0;
         }
 
@@ -158,48 +148,39 @@ public class MonsterController : MonoBehaviour
 
         if (currentHP <= 0)
         {
-            Debug.Log("Monstre tué");
-            Die(); // uniquement animation de mort
+            Die();
         }
         else
         {
-            animator?.PlayHurt(); // seulement s'il reste en vie
+            animator?.PlayHurt();
         }
     }
 
 
     public void Die()
     {
-        Debug.Log("Méthode Die Appellée");
         animator?.PlayDeath();
-        Debug.Log("Check Notify MonsterGroup 1");
 
-        // Disable collider immediately to prevent gold bag clipping
         Collider collider = GetComponent<Collider>();
         if (collider != null)
         {
             collider.enabled = false;
         }
 
-        // Grant experience to all party members
         GrantExperienceToParty();
 
-        // Drop gold bag (50% chance)
         StartCoroutine(CoroutineDropGoldBag());
 
         formationGroup?.NotifyMonsterDeath(this);
-        Debug.Log("Check Notify MonsterGroup 2");
         Destroy(gameObject, 2f);
     }
 
     private IEnumerator CoroutineDropGoldBag()
     {   
-        // 50% chance to drop gold
         if (Random.value < 0.5f)
         {
             if (goldBagPrefab != null)
             {
-                
                 Vector3 dropPosition;
                 if (goldSpawnPoint != null)
                 {
@@ -209,15 +190,10 @@ public class MonsterController : MonoBehaviour
                 {
                     dropPosition = transform.position + Vector3.up * goldDropYOffset;
                 }
-                //yield return new WaitForSeconds(1f);
+                
                 GameObject goldBag = Instantiate(goldBagPrefab, dropPosition, Quaternion.Euler(-90f, 0f, 0f));
-                Debug.Log($"[Loot] {gameObject.name} dropped gold at {dropPosition}");
             }
         }
-        else
-        {
-            Debug.Log($"[Loot] {gameObject.name} didn't drop gold (50% chance)");
-        }
         yield return null;
     }
 
@@ -246,18 +222,14 @@ public class MonsterController : MonoBehaviour
             character.experience -= 100;
             character.level++;
 
-            // Increase max HP and stamina on level up
-            int hpIncrease = 5 + character.constitution; // Base 5 + constitution bonus
-            int staminaIncrease = 5 + (character.constitution / 2); // Base 5 + half constitution
+            int hpIncrease = 5 + character.constitution;
+            int staminaIncrease = 5 + (character.constitution / 2);
 
             character.maxHP += hpIncrease;
-            character.currentHP += hpIncrease; // Also heal by the increase amount
+            character.currentHP += hpIncrease;
             character.maxFatigue += staminaIncrease;
-            character.currentFatigue += staminaIncrease; // Also restore by the increase amount
-
-            Debug.Log($"[Level Up] {character.characterName} reached level {character.level}! HP +{hpIncrease}, Stamina +{staminaIncrease}");
+            character.currentFatigue += staminaIncrease;
 
-            // Update all UI bars
             UIUpdater.Instance?.UpdateCharacterHP(character);
             UIUpdater.Instance?.UpdateCharacterFatigue(character);
             UIUpdater.Instance?.UpdateCharacterExperience(character);

+ 4 - 90
Assets/Scripts/Monsters/MonsterFormationGroup.cs

@@ -59,9 +59,7 @@ private IEnumerator DelayedStart()
         if (other.CompareTag("Player"))
         {
             hasDetectedPlayer = true;
-            Debug.Log("[MonsterGroup] Player entered detection zone");
             
-            // Only start chase if not already chasing or attacking
             if (!isChasing && attackLoopCoroutine == null)
             {
                 StartChase();
@@ -74,16 +72,13 @@ private IEnumerator DelayedStart()
         if (other.CompareTag("Player"))
         {
             hasDetectedPlayer = false;
-            Debug.Log("[MonsterGroup] Player exited detection zone");
             
-            // Stop attack loop if player leaves
             if (attackLoopCoroutine != null)
             {
                 StopCoroutine(attackLoopCoroutine);
                 attackLoopCoroutine = null;
             }
             
-            // Reset chase state
             isChasing = false;
         }
     }
@@ -143,29 +138,24 @@ private IEnumerator DelayedStart()
 
     public void NotifyMonsterDeath(MonsterController dead)
     {
-        Debug.Log("Boucle NotifyMonster");
-
         Vector3 deadPosition = dead.transform.position;
 
         if (frontRow.Contains(dead))
         {
-            Debug.Log("FrontRow ...");
             int index = frontRow.IndexOf(dead);
             frontRow.RemoveAt(index);
 
             if (backRow.Count > 0)
             {
-                Debug.Log("BackRow");
                 MonsterController replacement = GetClosestBacklinerTo(deadPosition);
                 backRow.Remove(replacement);
                 frontRow.Insert(index, replacement);
 
-                StartCoroutine(MoveReplacementWithDelay(replacement, deadPosition, 2f)); // 👈 délai de 2s
+                StartCoroutine(MoveReplacementWithDelay(replacement, deadPosition, 2f));
             }
         }
         else
         {
-            Debug.Log("BackRow Dead");
             backRow.Remove(dead);
         }
     }
@@ -181,28 +171,23 @@ private IEnumerator DelayedStart()
     {
         if (!isChasing)
         {
-            // Ajout de vérification avant de démarrer le combat
             if (UIUpdater.Instance == null || UIUpdater.Instance.IsReady == false)
             {
-                Debug.Log("[MonsterGroup] UI pas encore prête, attente du setup...");
                 StartCoroutine(WaitForUIThenChase());
                 return;
             }
 
-            Debug.Log("[MonsterGroup] StartChase() appelé");
             StartCoroutine(ChaseRoutine());
         }
     }
 
     IEnumerator WaitForUIThenChase()
     {
-        // Attend que UIUpdater soit prêt
         while (UIUpdater.Instance == null || UIUpdater.Instance.IsReady == false)
         {
             yield return null;
         }
 
-        Debug.Log("[MonsterGroup] UI prête, démarrage de la chasse !");
         StartCoroutine(ChaseRoutine());
     }
 
@@ -211,41 +196,32 @@ private IEnumerator DelayedStart()
     {
         isChasing = true;
         distanceTravelled = 0f;
-        
-        Debug.Log("[MonsterGroup] Chase routine started");
 
         while (isChasing && hasDetectedPlayer)
         {
-            // Check if player left detection zone
             if (!hasDetectedPlayer)
             {
-                Debug.Log("[MonsterGroup] Player left detection zone during chase");
                 isChasing = false;
                 yield break;
             }
             
             float distanceToPlayer = Vector3.Distance(transform.position, player.position);
 
-            // Reached attack range
             if (distanceToPlayer <= attackRange || IsAdjacentToPlayer())
             {
-                Debug.Log("[MonsterGroup] Reached attack range, starting combat");
                 isChasing = false;
                 attackLoopCoroutine = StartCoroutine(LoopAttack());
                 yield break;
             }
 
-            // Continue chasing
             Vector3 dirToPlayer = (player.position - transform.position).normalized;
             Vector3 step = new Vector3(Mathf.Round(dirToPlayer.x), 0, Mathf.Round(dirToPlayer.z)) * cellSize;
 
             MoveGroupBy(step);
             distanceTravelled += cellSize + 1f;
 
-            // Tactical pause every 5 meters
             if (distanceTravelled >= stopAfterDistance)
             {
-                Debug.Log("[MonsterGroup] Tactical pause after moving 5m");
                 yield return new WaitForSeconds(stopDuration);
                 distanceTravelled = 0f;
             }
@@ -255,7 +231,6 @@ private IEnumerator DelayedStart()
             }
         }
         
-        Debug.Log("[MonsterGroup] Chase routine ended");
         isChasing = false;
     }
 
@@ -271,21 +246,13 @@ private IEnumerator DelayedStart()
 
     private void Update()
     {
-        // Only act if player is in detection zone
         if (!hasDetectedPlayer) return;
-        
-        // If player not assigned yet, wait
         if (player == null) return;
-        
-        // Prevent interference with active states
         if (isChasing || attackLoopCoroutine != null) return;
         
-        // If not currently doing anything and player is detected
         if (!isChasing && attackLoopCoroutine == null)
         {
-            // Check if any front row monster is in attack range
             bool anyMonsterInAttackRange = false;
-            float closestMonsterDistance = float.MaxValue;
             
             if (frontRow.Count > 0)
             {
@@ -295,34 +262,25 @@ private IEnumerator DelayedStart()
                     {
                         float monsterToPlayerDist = Vector3.Distance(monster.transform.position, player.position);
                         
-                        if (monsterToPlayerDist < closestMonsterDistance)
-                        {
-                            closestMonsterDistance = monsterToPlayerDist;
-                        }
-                        
                         if (monsterToPlayerDist <= effectiveAttackRange)
                         {
                             anyMonsterInAttackRange = true;
+                            break;
                         }
                     }
                 }
             }
             else
             {
-                Debug.LogWarning("[MonsterGroup] Update: No front row monsters available!");
                 return;
             }
             
             if (anyMonsterInAttackRange)
             {
-                // Monsters are close enough to attack
-                Debug.Log($"[MonsterGroup] Update: Monsters in attack range (closest: {closestMonsterDistance:F1}m), starting attack loop");
                 attackLoopCoroutine = StartCoroutine(LoopAttack());
             }
             else
             {
-                // No monsters in attack range, should chase player
-                Debug.Log($"[MonsterGroup] Update: Monsters out of attack range (closest: {closestMonsterDistance:F1}m), starting chase");
                 StartChase();
             }
         }
@@ -335,68 +293,42 @@ private IEnumerator DelayedStart()
 
     IEnumerator LoopAttack()
     {
-        Debug.Log("[MonsterGroup] Attack loop started");
-        
         while (true)
         {
-            // Check if game manager says player is dead (prevents attacks during death sequence)
             if (GameManager.Instance != null && GameManager.Instance.IsPlayerDead())
             {
-                Debug.Log("[MonsterGroup] Player is dead, stopping attack");
                 attackLoopCoroutine = null;
                 yield break;
             }
             
-            // Check if player left detection zone completely
             if (!hasDetectedPlayer)
             {
-                Debug.Log("[MonsterGroup] Player left detection zone, stopping attack");
                 attackLoopCoroutine = null;
                 yield break;
             }
             
-            // Check if any party members are still alive
             if (cohesionManager == null || cohesionManager.groupMembers.Count == 0)
             {
-                Debug.Log("[MonsterGroup] No party members alive, stopping attack");
                 attackLoopCoroutine = null;
                 yield break;
             }
             
-            // Check if any monsters are still alive
             if (frontRow.Count == 0 && backRow.Count == 0)
             {
-                Debug.Log("[MonsterGroup] All monsters dead, stopping attack");
                 attackLoopCoroutine = null;
                 yield break;
             }
             
-            // Check if any monster is in attack range
             bool anyInRange = frontRow.Any(monster =>
                 monster != null && Vector3.Distance(monster.transform.position, player.position) <= effectiveAttackRange);
 
             if (!anyInRange)
             {
-                Debug.Log("[MonsterGroup] Player moved out of attack range - stopping attack loop");
                 attackLoopCoroutine = null;
-                
-                // Log state for debugging
-                Debug.Log($"[MonsterGroup] State after attack stop: hasDetectedPlayer={hasDetectedPlayer}, isChasing={isChasing}, attackLoopCoroutine={attackLoopCoroutine}");
-                
-                if (hasDetectedPlayer)
-                {
-                    Debug.Log("[MonsterGroup] Player still detected - Update() will handle re-engagement");
-                }
-                else
-                {
-                    Debug.Log("[MonsterGroup] Player no longer detected - will wait for re-entry");
-                }
-                
                 yield break;
             }
 
-            // Attack with each front row monster
-            foreach (var monster in frontRow.ToList()) // ToList to avoid modification during iteration
+            foreach (var monster in frontRow.ToList())
             {
                 if (monster == null) continue;
                 
@@ -411,29 +343,19 @@ private IEnumerator DelayedStart()
                     monster.StopMove();
                     monster.FaceTarget(player.position, instant: true);
                     
-                    // Verify monster is facing player (required for melee)
                     if (!monster.IsFacingTarget(player.position, 45f))
                     {
-                        Debug.Log($"[Combat] {monster.name} not facing player, skipping");
                         continue;
                     }
                     
                     monster.Attack();
 
-                    // Find the closest character on the party grid
                     var closest = cohesionManager.groupMembers
                         .OrderBy(charac => Vector3.Distance(monster.transform.position, new Vector3(charac.gridX, 0, charac.gridY)))
                         .FirstOrDefault();
 
-                    if (closest == null)
-                    {
-                        Debug.LogWarning("[Combat] No valid target found!");
-                        continue;
-                    }
-                    
-                    Debug.Log($"[Combat] Target: {closest.characterName}");
+                    if (closest == null) continue;
 
-                    // Apply damage to the character
                     var uiController = UIUpdater.Instance?.GetUIForCharacterByName(closest.characterName);
                     if (uiController != null)
                     {
@@ -443,26 +365,18 @@ private IEnumerator DelayedStart()
 
                         uiController.UpdateHPBar();
                         uiController.ShowDamageOnCard(damage);
-                        Debug.Log($"[Combat] {monster.name} dealt {damage} damage to {closest.characterName} ({closest.currentHP}/{closest.maxHP} HP remaining)");
                         
-                        // Check if character died
                         if (closest.currentHP <= 0)
                         {
-                            Debug.Log($"[Combat] {closest.characterName} has been defeated!");
                             uiController.HandleCharacterDeath();
                         }
                     }
-                    else
-                    {
-                        Debug.LogWarning($"[Combat] UI not found for {closest.characterName}");
-                    }
 
                     yield return new WaitForSeconds(attackInterval);
                 }
             }
 
             yield return new WaitForSeconds(attackRepeatDelay);
-            Debug.Log("[MonsterGroup] Starting next attack round...");
         }
     }
 

+ 0 - 10
Assets/Scripts/Movement/PlayerMovement.cs

@@ -40,10 +40,8 @@ public class GridMovement : MonoBehaviour
     void TryMove(Vector3 direction)
     {
         Vector3 origin = transform.position + Vector3.up * 0.5f;
-        Debug.DrawRay(origin, direction * wallCheckDistance, Color.red, 1f);
         if (Physics.Raycast(origin, direction, wallCheckDistance, obstacleLayer))
         {
-            Debug.Log("Obstacle détecté devant, déplacement interdit.");
             return;
         }
 
@@ -61,14 +59,6 @@ public class GridMovement : MonoBehaviour
                 }
                 StartCoroutine(Move(targetPos));
             }
-            else
-            {
-                Debug.Log("Aucun sol détecté sous la position cible.");
-            }
-        }
-        else
-        {
-            Debug.Log("Déplacement bloqué : zone interdite.");
         }
     }
 

+ 1 - 2
Assets/Scripts/Movement/PositionGridManager.cs

@@ -70,11 +70,10 @@ public class PositionGridManager : MonoBehaviour
 
     public void AddCharacter(CharacterInGroup c)
     {
-        Debug.Log("Personnage Ajouté");
         if (!characters.Contains(c))
             characters.Add(c);
 
-        UpdateGridDisplay(); // bonus : met à jour la grille visuelle !
+        UpdateGridDisplay();
     }
 
     public CharacterInGroup GetFrontlineTarget(Vector3 attackerDirection)

+ 3 - 9
Assets/Scripts/Skills/FireballProjectile.cs

@@ -26,7 +26,6 @@ public void Setup(Vector3 target, float speed, GameObject explosionPrefab)
     this.speed = speed;
     this.explosionPrefab = explosionPrefab;
 
-    // Empêcher collision immédiate avec le joueur
     GameObject player = GameObject.FindWithTag("Player");
     if (player != null)
     {
@@ -35,7 +34,6 @@ public void Setup(Vector3 target, float speed, GameObject explosionPrefab)
             Physics.IgnoreCollision(ownerCollider, GetComponent<Collider>());
     }
 
-    // Attendre un peu avant de pouvoir exploser
     StartCoroutine(EnableExplosionAfterDelay(0.1f));
 }
 
@@ -47,23 +45,19 @@ private IEnumerator EnableExplosionAfterDelay(float delay)
 
 private void OnTriggerEnter(Collider other)
 {
-    if (!canExplode) return; // Ignore si pas prêt !
+    if (!canExplode) return;
 
-    Debug.Log("[FireballSetup] " + other.name);
     if (other.CompareTag("Monster"))
     {
-        Debug.Log("[Fireball] Monstre touché !");
         MonsterController monster = other.GetComponent<MonsterController>();
         if (monster != null)
         {
-            Debug.Log("Damage to monster");
-            monster.TakeDamage(30); // dégâts
+            monster.TakeDamage(30);
         }
         Explode();
     }
-    else if (!other.isTrigger) // Ignore triggers comme les zones
+    else if (!other.isTrigger)
     {
-        Debug.Log("[Fireball] " + other.name);
         Explode();
     }
 }

+ 1 - 25
Assets/Scripts/Skills/FirstPersonWeapon.cs

@@ -47,22 +47,16 @@ public class FirstPersonWeapon : MonoBehaviour
    void TryHitMonster()
     {
         GameObject player = GameObject.FindWithTag("Player");
-        if (player == null)
-        {
-            Debug.LogWarning("[Combat] Player not found!");
-            return;
-        }
+        if (player == null) return;
 
         Vector3 playerPos = player.transform.position;
         Vector3 playerForward = player.transform.forward;
 
-        // Find all monsters that are in range and in front of player
         List<MonsterController> validTargets = new List<MonsterController>();
 
         var monsterGroups = FindObjectsByType<MonsterFormationGroup>(FindObjectsSortMode.None);
         foreach (var group in monsterGroups)
         {
-            // Check both front and back row
             var allMonsters = new List<MonsterController>();
             allMonsters.AddRange(group.frontRow);
             allMonsters.AddRange(group.backRow);
@@ -74,34 +68,21 @@ public class FirstPersonWeapon : MonoBehaviour
                 Vector3 monsterPos = monster.transform.position;
                 float distance = Vector3.Distance(playerPos, monsterPos);
 
-                // Check if monster is within attack range
                 if (distance <= attackRange)
                 {
-                    // Check if monster is in front of player
                     Vector3 directionToMonster = (monsterPos - playerPos).normalized;
                     float angle = Vector3.Angle(playerForward, directionToMonster);
 
                     if (angle <= attackAngle / 2f)
                     {
                         validTargets.Add(monster);
-                        Debug.Log($"[Combat] Valid target found: {monster.name} at {distance:F2}m, angle {angle:F1}°");
-                    }
-                    else
-                    {
-                        Debug.Log($"[Combat] {monster.name} is out of angle: {angle:F1}° (max {attackAngle / 2f}°)");
                     }
                 }
-                else
-                {
-                    Debug.Log($"[Combat] {monster.name} is too far: {distance:F2}m (max {attackRange}m)");
-                }
             }
         }
 
-        // Attack the closest valid target
         if (validTargets.Count > 0)
         {
-            // Sort by distance and hit the closest one
             validTargets.Sort((a, b) => 
             {
                 float distA = Vector3.Distance(playerPos, a.transform.position);
@@ -111,14 +92,9 @@ public class FirstPersonWeapon : MonoBehaviour
 
             MonsterController target = validTargets[0];
             target.TakeDamage(damageAmount);
-            Debug.Log($"[Combat] Hit {target.name}! Damage: {damageAmount}");
 
             ShowDamagePopup(target.transform.position + Vector3.up * 2f, damageAmount);
         }
-        else
-        {
-            Debug.Log("[Combat] No valid targets in range and in front of player!");
-        }
     }
 
     void ShowDamagePopup(Vector3 position, int amount)

+ 6 - 12
Assets/Scripts/Skills/SpellCastingManager.cs

@@ -6,26 +6,25 @@ public class SpellCastingManager : MonoBehaviour
     public GameObject explosionPrefab;
     public float fireballSpeed = 10f;
     private bool isAiming = false;
-    private Texture2D aimingCursorTexture; // 👈 Nouveau
-    private Texture2D defaultCursorTexture; // 👈 Sauvegarde du curseur de base
+    private Texture2D aimingCursorTexture;
+    private Texture2D defaultCursorTexture;
     public float verticalOffset = -1.5f;
 
     public void StartFireballCasting(Texture2D skillIcon)
     {
         isAiming = true;
 
-        defaultCursorTexture = null; // Peut être remplacé par ton propre curseur par défaut si tu veux
+        defaultCursorTexture = null;
         aimingCursorTexture = skillIcon;
 
         Cursor.SetCursor(aimingCursorTexture, Vector2.zero, CursorMode.Auto);
-        Debug.Log("Mode de visée activé !");
     }
 
     void Update()
     {
         if (isAiming)
         {
-            if (Input.GetMouseButtonDown(0)) // Clic gauche pour tirer
+            if (Input.GetMouseButtonDown(0))
             {
                 Vector3 targetPos = GetWorldClickPosition();
                 if (targetPos != Vector3.zero)
@@ -34,9 +33,8 @@ public class SpellCastingManager : MonoBehaviour
                     ResetCursor();
                 }
             }
-            else if (Input.GetMouseButtonDown(1)) // Clic droit pour annuler
+            else if (Input.GetMouseButtonDown(1))
             {
-                Debug.Log("Visée annulée.");
                 ResetCursor();
             }
         }
@@ -62,15 +60,11 @@ void LaunchFireball(Vector3 target)
         GameObject fireball = Instantiate(fireballPrefab, spawnPos, Quaternion.identity);
         fireball.AddComponent<FireballProjectile>().Setup(target, fireballSpeed, explosionPrefab);
     }
-    else
-    {
-        Debug.LogError("[SpellCasting] Aucun Player trouvé dans la scène !");
-    }
 }
 
     void ResetCursor()
     {
         isAiming = false;
-        Cursor.SetCursor(defaultCursorTexture, Vector2.zero, CursorMode.Auto); // revienne normal
+        Cursor.SetCursor(defaultCursorTexture, Vector2.zero, CursorMode.Auto);
     }
 }

+ 9 - 95
Assets/Scripts/UI/CharacterUIController.cs

@@ -50,11 +50,10 @@ public class CharacterUIController : MonoBehaviour
 
         if (expSlider != null)
         {
-            expSlider.maxValue = 100; // ou prochain seuil de level
+            expSlider.maxValue = 100;
             expSlider.value = character.experience;
         }
 
-        // Bind des boutons
         if (attackButton != null)
             attackButton.onClick.AddListener(OnAttack);
         if (repeatActionButton != null)
@@ -64,7 +63,6 @@ public class CharacterUIController : MonoBehaviour
         if (openInventoryButton != null)
             openInventoryButton.onClick.AddListener(OnOpenInventory);
 
-        // Enregistrement dans l'UIUpdater
         UIUpdater.Instance?.Register(character, this);
 
         PopulateSkillList();
@@ -73,23 +71,14 @@ public class CharacterUIController : MonoBehaviour
         {
             cooldownOverlay.gameObject.SetActive(false);
         }
-        
-        Debug.Log($"[UI Setup] {character.characterName} - HP: {character.currentHP}/{character.maxHP}, Fatigue: {character.currentFatigue}/{character.maxFatigue}");
     }
 
     public void ShowDamageOnCard(int amount)
     {
-   
-
         if (damageUIPrefab != null && damageSpawnPoint != null)
         {
-            Debug.Log($"[Damage UI] {character.characterName} subit {amount} dégâts");
             damageUIPrefab.SpawnGUI(damageSpawnPoint, Vector2.zero, amount);
         }
-        else
-        {
-            Debug.LogWarning("Damage UI prefab ou spawn point manquant pour " + character.characterName);
-        }
     }
 
 
@@ -121,25 +110,19 @@ public class CharacterUIController : MonoBehaviour
 
     void OnAttack()
     {
-        Debug.Log(character.characterName + " attaque ! - CHARUICONTR");
-        
-        // Check if character has no stamina - 80% miss chance
         if (character.currentFatigue <= 0)
         {
-            if (Random.value < 0.8f) // 80% chance to miss
+            if (Random.value < 0.8f)
             {
-                Debug.Log($"[Combat] {character.characterName} est trop fatigué et rate son attaque !");
                 DisableButtonsTemporarily(5f);
                 return;
             }
         }
         
-        // 30% chance to consume stamina when attacking
         if (Random.value < 0.3f && character.currentFatigue > 0)
         {
             character.currentFatigue = Mathf.Max(0, character.currentFatigue - 5);
             UIUpdater.Instance?.UpdateCharacterFatigue(character);
-            Debug.Log($"[Combat] {character.characterName} consomme 5 stamina en attaquant");
         }
         
         character.lastAction = ActionType.Attack;
@@ -149,20 +132,14 @@ public class CharacterUIController : MonoBehaviour
 
 void OnSkillButtonClicked(SkillData skillData)
 {
-    Debug.Log($"Compétence sélectionnée : {skillData.skillName}");
-
-    // Check if character has enough stamina to cast skill
-    int staminaCost = 15; // Default stamina cost for skills
+    int staminaCost = 15;
     if (character.currentFatigue < staminaCost)
     {
-        Debug.Log($"[Combat] {character.characterName} n'a pas assez de stamina pour utiliser {skillData.skillName} !");
         return;
     }
 
-    // Consume stamina
     character.currentFatigue = Mathf.Max(0, character.currentFatigue - staminaCost);
     UIUpdater.Instance?.UpdateCharacterFatigue(character);
-    Debug.Log($"[Combat] {character.characterName} consomme {staminaCost} stamina pour {skillData.skillName}");
 
     if (skillData.skillName == "Boule de Feu")
     {
@@ -170,10 +147,6 @@ void OnSkillButtonClicked(SkillData skillData)
         character.lastAction = ActionType.UseSkill;
         character.lastSkillName = skillData.skillName;
     }
-    else
-    {
-        Debug.Log($"Action pour {skillData.skillName} non encore implémentée.");
-    }
     
     DisableButtonsTemporarily(5f);
 }
@@ -185,14 +158,10 @@ void OnSkillButtonClicked(SkillData skillData)
         switch (character.lastAction)
         {
             case ActionType.Attack:
-                Debug.Log($"{character.characterName} répète : Attaque !");
                 OnAttack();
-                return; // OnAttack already calls DisableButtonsTemporarily
+                return;
 
             case ActionType.UseSkill:
-                Debug.Log($"{character.characterName} répète : Skill {character.lastSkillName}");
-                
-                // Find the skill and use it again
                 var learnedSkill = character.learnedSkills.Find(s => s.GetData()?.skillName == character.lastSkillName);
                 if (learnedSkill != null)
                 {
@@ -200,19 +169,15 @@ void OnSkillButtonClicked(SkillData skillData)
                     if (skillData != null)
                     {
                         OnSkillButtonClicked(skillData);
-                        return; // OnSkillButtonClicked already calls DisableButtonsTemporarily
+                        return;
                     }
                 }
-                Debug.LogWarning($"Couldn't find previous skill: {character.lastSkillName}");
                 break;
 
             case ActionType.Heal:
-                Debug.Log($"{character.characterName} répète : Soin !");
-                // Appelle ton système de heal
                 break;
 
             default:
-                Debug.Log($"{character.characterName} n'a aucune action précédente.");
                 break;
         }
         DisableButtonsTemporarily(5f);
@@ -227,80 +192,42 @@ void OnSkillButtonClicked(SkillData skillData)
     
     void OnOpenInventory()
     {
-        Debug.Log($"{character.characterName} ouvre son inventaire");
-        
         if (inventoryPanel != null)
         {
             inventoryPanel.SetActive(!inventoryPanel.activeSelf);
             
-            // Bind the inventory to this character if opening
             if (inventoryPanel.activeSelf && inventoryUIController != null)
             {
                 inventoryUIController.Bind(character);
             }
         }
-        else
-        {
-            Debug.LogWarning("Inventory panel is not assigned in the inspector!");
-        }
     }
 
-    // Méthode appelée pour mettre à jour dynamiquement les PV
     public void UpdateHPBar()
     {
-        if (hpSlider == null) 
-        {
-            Debug.LogWarning($"[UI] HP Slider is null for {character?.characterName}");
-            return;
-        }
-        
-        if (character == null)
-        {
-            Debug.LogWarning("[UI] Character reference is null in UpdateHPBar");
-            return;
-        }
+        if (hpSlider == null || character == null) return;
         
-        Debug.Log($"[UI] Mise à jour barre de vie : {character.characterName} ({character.currentHP}/{character.maxHP})");
-        
-        // Update max first, then value to ensure proper ratio
         hpSlider.maxValue = character.maxHP;
         hpSlider.value = character.currentHP;
         
-        // Force layout rebuild to ensure visual update
         UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(hpSlider.GetComponent<RectTransform>());
     }
 
     public void UpdateFatigueBar()
     {
-        if (fatigueSlider == null) 
-        {
-            Debug.LogWarning($"[UI] Fatigue Slider is null for {character?.characterName}");
-            return;
-        }
-        
-        if (character == null) return;
+        if (fatigueSlider == null || character == null) return;
         
-        fatigueSlider.maxValue = character.maxFatigue; // Update max in case of level up
+        fatigueSlider.maxValue = character.maxFatigue;
         fatigueSlider.value = character.currentFatigue;
         UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(fatigueSlider.GetComponent<RectTransform>());
-        
-        Debug.Log($"[UI] Fatigue bar updated: {character.characterName} ({character.currentFatigue}/{character.maxFatigue})");
     }
 
     public void UpdateExpBar()
     {
-        if (expSlider == null) 
-        {
-            Debug.LogWarning($"[UI] Exp Slider is null for {character?.characterName}");
-            return;
-        }
-        
-        if (character == null) return;
+        if (expSlider == null || character == null) return;
         
         expSlider.value = character.experience;
         UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(expSlider.GetComponent<RectTransform>());
-        
-        Debug.Log($"[UI] Experience bar updated: {character.characterName} ({character.experience}/100)");
     }
 
         public void DisableButtonsTemporarily(float duration)
@@ -352,38 +279,25 @@ void OnSkillButtonClicked(SkillData skillData)
 
     public void HandleCharacterDeath()
     {
-        Debug.Log($"[Death] {character.characterName} est mort, suppression de la carte UI");
-        
         string characterName = character.characterName;
         
-        // Remove character from the party
         TeamCohesionManager cohesionManager = FindFirstObjectByType<TeamCohesionManager>();
         if (cohesionManager != null)
         {
             cohesionManager.groupMembers.Remove(character);
         }
         
-        // Remove from UIUpdater registry
         UIUpdater.Instance?.Unregister(characterName);
         
-        // Destroy the card UI
         Destroy(gameObject);
         
-        // Check if all characters are dead (party wipe)
         if (cohesionManager != null && cohesionManager.groupMembers.Count == 0)
         {
-            Debug.Log("[Game Over] All party members are dead! Triggering respawn system...");
-            
-            // Notify GameManager of party wipe
             var gameManagerObj = GameObject.Find("GameManager");
             if (gameManagerObj != null)
             {
                 gameManagerObj.SendMessage("OnPartyWiped", SendMessageOptions.DontRequireReceiver);
             }
-            else
-            {
-                Debug.LogError("[Death] GameManager not found! Cannot trigger respawn system.");
-            }
         }
     }
 

+ 0 - 19
Assets/Scripts/UI/DeathScreenUI.cs

@@ -2,10 +2,6 @@ using UnityEngine;
 using UnityEngine.UI;
 using TMPro;
 
-/// <summary>
-/// Manages the death screen UI display and respawn button.
-/// Shows random death messages and handles respawn button clicks.
-/// </summary>
 public class DeathScreenUI : MonoBehaviour
 {
     public static DeathScreenUI Instance { get; private set; }
@@ -29,7 +25,6 @@ public class DeathScreenUI : MonoBehaviour
     public float fadeInDuration = 1f;
     public bool randomizeMessage = true;
 
-    #region Initialization
 
     private void Awake()
     {
@@ -55,11 +50,6 @@ public class DeathScreenUI : MonoBehaviour
 
     private void ValidateReferences()
     {
-        if (deathPanel == null)
-            Debug.LogWarning("[DeathScreenUI] Death Panel not assigned in Inspector");
-        
-        if (respawnButton == null)
-            Debug.LogWarning("[DeathScreenUI] Respawn Button not assigned in Inspector");
     }
 
     private void BindButton()
@@ -70,9 +60,7 @@ public class DeathScreenUI : MonoBehaviour
         }
     }
 
-    #endregion
 
-    #region Show/Hide
 
     public void Show()
     {
@@ -114,9 +102,7 @@ public class DeathScreenUI : MonoBehaviour
         canvasGroup.alpha = 1f;
     }
 
-    #endregion
 
-    #region Button Handlers
 
     private void OnRespawnButtonClicked()
     {
@@ -125,11 +111,6 @@ public class DeathScreenUI : MonoBehaviour
         {
             gameManagerObj.SendMessage("RespawnParty", SendMessageOptions.DontRequireReceiver);
         }
-        else
-        {
-            Debug.LogError("[DeathScreenUI] GameManager not found!");
-        }
     }
 
-    #endregion
 }

+ 1 - 9
Assets/Scripts/UI/InventoryItem.cs

@@ -29,24 +29,18 @@ public class InventoryItem
     
     public void Use(CharacterInGroup character)
     {
-        if (itemType != ItemType.Consumable)
-        {
-            Debug.Log($"{itemName} is not consumable!");
-            return;
-        }
+        if (itemType != ItemType.Consumable) return;
         
         switch (consumableEffect)
         {
             case ConsumableEffect.RestoreStamina:
                 character.currentFatigue = Mathf.Min(character.maxFatigue, character.currentFatigue + effectAmount);
                 UIUpdater.Instance?.UpdateCharacterFatigue(character);
-                Debug.Log($"{character.characterName} consumes {itemName} and restores {effectAmount} stamina");
                 break;
                 
             case ConsumableEffect.RestoreHealth:
                 character.currentHP = Mathf.Min(character.maxHP, character.currentHP + effectAmount);
                 UIUpdater.Instance?.UpdateCharacterHP(character);
-                Debug.Log($"{character.characterName} consumes {itemName} and restores {effectAmount} HP");
                 break;
                 
             case ConsumableEffect.RestoreBoth:
@@ -54,11 +48,9 @@ public class InventoryItem
                 character.currentHP = Mathf.Min(character.maxHP, character.currentHP + effectAmount);
                 UIUpdater.Instance?.UpdateCharacterFatigue(character);
                 UIUpdater.Instance?.UpdateCharacterHP(character);
-                Debug.Log($"{character.characterName} consumes {itemName} and restores {effectAmount} HP and Stamina");
                 break;
         }
         
-        // Reduce quantity
         quantity--;
     }
 }

+ 0 - 5
Assets/Scripts/UI/PartyUIManager.cs

@@ -11,7 +11,6 @@ public class PartyUIManager : MonoBehaviour
 
     void Start()
     {
-        Debug.Log("#D001 > Reading Character Cards");
         DisplayPartyUI();
     }
 
@@ -25,7 +24,6 @@ public class PartyUIManager : MonoBehaviour
             var character = cohesionManager.groupMembers[i];
 
             GameObject card = Instantiate(characterCardPrefab, cardContainer);
-            Debug.Log("#D001 > Character Card Instantiated");
 
             CharacterUIController ui = card.GetComponent<CharacterUIController>();
 
@@ -35,10 +33,7 @@ public class PartyUIManager : MonoBehaviour
 
             ui.Setup(character, weapon);
             UIUpdater.Instance?.Register(character, ui);
-
-            Debug.Log($"[UI Setup] Enregistrement de {character.characterName} (hashCode={character.GetHashCode()})");
             UIUpdater.Instance?.MarkReady();
-
         }
     }
 

+ 0 - 28
Assets/Scripts/UI/UIUpdater.cs

@@ -19,8 +19,6 @@ public class UIUpdater : MonoBehaviour
 
    public void Register(CharacterInGroup character, CharacterUIController ui)
 {
-    Debug.Log($"[DEBUG] Enregistrement dans UIUpdater : {character.characterName}");
-    
     if (!characterToUI.ContainsKey(character.characterName))
         characterToUI.Add(character.characterName, ui);
 }
@@ -30,25 +28,19 @@ public class UIUpdater : MonoBehaviour
         if (characterToUI.ContainsKey(characterName))
         {
             characterToUI.Remove(characterName);
-            Debug.Log($"[DEBUG] Désenregistrement de {characterName} dans UIUpdater");
         }
     }
 
-
-    
-    // Juste après la méthode Register
     public void MarkReady()
     {
         IsReady = true;
     }
 
-        // Si tu veux chercher un UI via juste le nom du personnage
     public CharacterUIController GetUIForCharacterByName(string name)
     {
         if (characterToUI.TryGetValue(name, out var ui))
             return ui;
 
-        Debug.LogWarning($"[Combat] Aucun UI trouvé pour {name}");
         return null;
     }
 
@@ -79,31 +71,11 @@ public class UIUpdater : MonoBehaviour
 
     public CharacterUIController GetUIForCharacter(CharacterInGroup character)
     {
-        Debug.Log($"[DEBUG] Recherche UI pour {character.characterName}");
-
         if (characterToUI.TryGetValue(character.characterName, out var ui))
         {
-            Debug.Log($"[DEBUG] UI TROUVÉ pour {character.characterName}");
             return ui;
         }
         
-        Debug.LogWarning($"[DEBUG] Aucun UI trouvé pour {character.characterName}");
         return null;
     }
-
-    //death ui?
 }
-
-
-// Calls
-//Exemple : quand un personnage se soigne :
-// character.currentHP = Mathf.Min(character.maxHP, character.currentHP + 12);
-// UIUpdater.Instance?.UpdateCharacterHP(character);
-
-//  Exemple : quand il gagne de l'expérience :
-// character.experience += 15;
-// UIUpdater.Instance?.UpdateCharacterExperience(character);
-
-//  Exemple : quand il récupère de la fatigue (repos, potion...) :
-// character.currentFatigue = Mathf.Max(0, character.currentFatigue - 10);
-// UIUpdater.Instance?.UpdateCharacterFatigue(character);

+ 0 - 267
CODE_CLEANUP_SUMMARY.md

@@ -1,267 +0,0 @@
-# Code Cleanup & Fallback Respawn Summary
-
-## ✅ What Was Done
-
-### 1. **Code Organization**
-All respawn system scripts have been reorganized with clear regions and improved structure:
-
-#### **GameManager.cs**
-- ✅ Organized into logical regions:
-  - `#region Initialization` - Setup and validation
-  - `#region Death & Respawn` - Death handling and respawn logic
-  - `#region Monster Management` - Stop/reset monsters
-  - `#region Fade Effects` - Screen transitions
-  - `#region Public API` - Public methods
-- ✅ Removed excessive debug logs
-- ✅ Kept important warnings and errors
-- ✅ Simplified code structure
-
-#### **CheckpointSystem.cs**
-- ✅ Completely reorganized with clear regions:
-  - `#region Initialization` - Setup and fallback capture
-  - `#region Checkpoint Save` - Checkpoint saving logic
-  - `#region Checkpoint Load` - Checkpoint loading logic
-  - `#region Checkpoint Triggers` - Trigger detection
-  - `#region Public API` - Public methods
-- ✅ Removed all excessive debug logs
-- ✅ Clean, readable code
-
-#### **DeathScreenUI.cs**
-- ✅ Organized into regions:
-  - `#region Initialization` - Setup and validation
-  - `#region Show/Hide` - UI display logic
-  - `#region Button Handlers` - Button click handlers
-- ✅ Clean and minimal
-- ✅ Only essential debug logs
-
----
-
-### 2. **Fallback Respawn System** ⭐ NEW FEATURE
-
-#### **How It Works:**
-The system now automatically captures the player's starting position when the game starts and uses it as a fallback respawn point.
-
-#### **Implementation:**
-```csharp
-// In CheckpointSystem.cs
-private Vector3 fallbackSpawnPosition;
-private Quaternion fallbackSpawnRotation;
-private bool hasFallbackSpawn = false;
-
-private void CaptureFallbackSpawn()
-{
-    if (playerTransform != null)
-    {
-        fallbackSpawnPosition = playerTransform.position;
-        fallbackSpawnRotation = playerTransform.rotation;
-        hasFallbackSpawn = true;
-    }
-}
-```
-
-#### **Respawn Priority:**
-1. **If checkpoint exists** → Respawn at checkpoint
-2. **If no checkpoint** → Respawn at fallback (player's start position)
-3. **If neither** → Restore characters in place (shouldn't happen)
-
-#### **Benefits:**
-- ✅ **Automatic** - No manual setup required
-- ✅ **Simple** - Captures position on game start
-- ✅ **Efficient** - No extra GameObjects needed
-- ✅ **Reliable** - Always have a fallback spawn point
-
----
-
-### 3. **Debug Log Cleanup**
-
-#### **Removed Logs:**
-- ❌ Step-by-step respawn sequence logs
-- ❌ Verbose checkpoint loading logs
-- ❌ Unnecessary status updates
-- ❌ Monster stop confirmation logs
-- ❌ Character restoration details
-- ❌ UI rebuild confirmations
-
-#### **Kept Logs:**
-- ✅ Warnings (missing references, no checkpoint)
-- ✅ Errors (critical failures)
-- ✅ Important events (fallback spawn captured, checkpoint saved)
-
----
-
-## 🎮 How The System Works Now
-
-### **Death Sequence:**
-```
-Player Dies
-    ↓
-Party Wipe Detected
-    ↓
-Disable Player Input
-    ↓
-Stop Monster Attacks
-    ↓
-Fade to Black (2 seconds)
-    ↓
-Show Death Screen
-```
-
-### **Respawn Sequence:**
-```
-Click RESPAWN Button
-    ↓
-Hide Death Screen
-    ↓
-Load Checkpoint (or Fallback)
-    ↓
-Restore Party to Full HP/Stamina
-    ↓
-Recreate Party UI
-    ↓
-Fade from Black (1 second)
-    ↓
-Re-enable Player Input
-    ↓
-Ready to Play!
-```
-
-### **Fallback Respawn Logic:**
-```csharp
-public void LoadCheckpoint()
-{
-    if (hasCheckpoint)
-    {
-        LoadSavedCheckpoint();  // Use checkpoint
-    }
-    else if (hasFallbackSpawn)
-    {
-        LoadFallbackSpawn();    // Use player's start position
-    }
-    else
-    {
-        RestoreCharactersInPlace();  // Last resort
-    }
-}
-```
-
----
-
-## 📋 What Changed (Before → After)
-
-### **GameManager.cs**
-```
-Before: 318 lines, scattered logic, excessive logs
-After:  ~200 lines, organized regions, minimal logs
-```
-
-### **CheckpointSystem.cs**
-```
-Before: 279 lines, verbose logging, no fallback
-After:  ~250 lines, organized, automatic fallback spawn
-```
-
-### **DeathScreenUI.cs**
-```
-Before: 135 lines, auto-creation code
-After:  ~120 lines, clean structure, manual UI only
-```
-
----
-
-## 🔧 Usage
-
-### **No Changes Needed to Your Setup!**
-Everything works automatically:
-
-1. **Game starts** → Fallback spawn position captured
-2. **Player enters checkpoint** → Checkpoint saved
-3. **Player dies without checkpoint** → Respawns at start position ✨
-4. **Player dies with checkpoint** → Respawns at checkpoint
-
-### **Example Scenarios:**
-
-#### **Scenario 1: Player dies immediately (no checkpoint)**
-```
-Player spawns at (0, 0, 0)
-Player runs forward and dies at (10, 0, 5)
-Respawn → Back to (0, 0, 0) [fallback spawn]
-```
-
-#### **Scenario 2: Player reaches checkpoint**
-```
-Player spawns at (0, 0, 0)
-Player enters checkpoint at (50, 0, 20)
-Checkpoint saved!
-Player dies at (60, 0, 25)
-Respawn → Back to (50, 0, 20) [checkpoint]
-```
-
-#### **Scenario 3: Player enters multiple checkpoints**
-```
-Player spawns at (0, 0, 0)
-Player enters checkpoint A at (25, 0, 10)
-Player enters checkpoint B at (50, 0, 30)  ← Latest checkpoint
-Player dies at (60, 0, 40)
-Respawn → Back to (50, 0, 30) [latest checkpoint]
-```
-
----
-
-## 📊 Code Quality Improvements
-
-### **Before:**
-- Scattered debug logs everywhere
-- Hard to read and maintain
-- No clear structure
-- Verbose comments
-
-### **After:**
-- ✅ Clear region organization
-- ✅ Minimal, essential debug logs
-- ✅ Easy to navigate
-- ✅ Self-documenting code
-- ✅ Professional structure
-
----
-
-## 🎯 Summary
-
-### **Key Improvements:**
-1. ✅ **Automatic fallback respawn** using player's start position
-2. ✅ **Code organized** into logical regions
-3. ✅ **Debug logs cleaned up** (only important ones remain)
-4. ✅ **No breaking changes** - everything still works
-5. ✅ **More maintainable** code structure
-
-### **New Feature: Fallback Respawn**
-- Automatically captures player's starting position
-- Used when no checkpoint has been reached
-- Zero setup required
-- Most efficient solution
-
----
-
-## ⚡ Performance
-
-The fallback system has **zero performance impact**:
-- Captures position once at start (1 Vector3, 1 Quaternion)
-- No runtime checks or calculations
-- No additional GameObjects
-- Minimal memory footprint
-
----
-
-## 🔍 Testing
-
-Test the fallback system:
-
-1. **Start game** (don't enter any checkpoints)
-2. **Move away from start position**
-3. **Press K** to kill party (or let monsters kill you)
-4. **Click RESPAWN**
-5. **Result:** You respawn at your starting position! ✨
-
----
-
-**All code is clean, organized, and production-ready!** 🎉
-

+ 0 - 241
MONSTER_DETECTION_IMPROVEMENTS.md

@@ -1,241 +0,0 @@
-# Monster Detection & Behavior Improvements
-
-## Summary
-Applied minimal, targeted fixes to improve monster detection, rotation smoothness, and attack consistency based on analysis of the existing system.
-
----
-
-## Changes Made
-
-### 1. ✅ Added Configurable Rotation Speed (MonsterController.cs)
-
-**Location**: Lines 15, 83
-
-**What Changed**:
-```csharp
-// NEW: Added public field
-public float rotationSpeed = 8f; // Higher = smoother rotation
-
-// UPDATED: FaceTarget() now uses configurable speed
-transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * rotationSpeed);
-```
-
-**Why**: 
-- Previous hardcoded value of `5f` was okay but not customizable
-- New default of `8f` provides smoother rotation
-- Can be adjusted per-monster in Unity Inspector
-- Makes direction changes feel more natural during movement
-
-**Impact**: 🟢 Low - Improves visual smoothness, no gameplay impact
-
----
-
-### 2. ✅ Added Per-Monster Distance Check (MonsterFormationGroup.cs)
-
-**Location**: Lines 397-403
-
-**What Changed**:
-```csharp
-// NEW: Check if each specific monster is close enough before attacking
-float distanceToPlayer = Vector3.Distance(monster.transform.position, player.position);
-if (distanceToPlayer > effectiveAttackRange)
-{
-    Debug.Log($"[Combat] {monster.name} too far to attack ({distanceToPlayer:F1}m > {effectiveAttackRange:F1}m)");
-    continue;
-}
-```
-
-**Why**:
-- Previous system only checked if ANY monster was in range
-- Caused distant monsters in formation to attack when they shouldn't
-- Now each monster validates their own distance before attacking
-- Prevents "teleporting attacks" from back-row monsters
-
-**Impact**: 🟡 Medium - Fixes major combat issue, improves realism
-
----
-
-### 3. ✅ Standardized Attack Range Checks (MonsterFormationGroup.cs)
-
-**Location**: Lines 20-22, 303, 368
-
-**What Changed**:
-```csharp
-// NEW: Consistent attack range calculation
-private const float ATTACK_RANGE_BUFFER = 0.5f;
-private float effectiveAttackRange => attackRange + ATTACK_RANGE_BUFFER;
-
-// UPDATED: All checks now use effectiveAttackRange
-if (monsterToPlayerDist <= effectiveAttackRange)  // Line 303
-if (...Distance(...) <= effectiveAttackRange)    // Line 368
-```
-
-**Before** (Inconsistent):
-| Location | Range Used |
-|----------|------------|
-| Update() | `attackRange + 0.5f` |
-| LoopAttack() | `attackRange + 0.5f` |
-| ChaseRoutine() | `attackRange` (no buffer) |
-
-**After** (Consistent):
-- All checks use `effectiveAttackRange` (6.5f by default)
-- Single source of truth for attack range
-- Easy to adjust if needed
-
-**Why**:
-- Inconsistent ranges caused confusing behavior
-- Monsters would chase/stop/attack at different distances
-- Now all combat logic uses same range definition
-
-**Impact**: 🟢 Low - Fixes consistency issue, makes behavior predictable
-
----
-
-### 4. ✅ Prevented Update() State Interference (MonsterFormationGroup.cs)
-
-**Location**: Lines 280-281
-
-**What Changed**:
-```csharp
-// NEW: Early return if already in active state
-if (isChasing || attackLoopCoroutine != null) return;
-```
-
-**Why**:
-- Update() runs every frame (60+ times/second)
-- Could restart chase/attack while already running
-- Created race conditions and duplicate coroutines
-- Now guards against interfering with active states
-
-**Impact**: 🟡 Medium - Prevents potential bugs and duplicate behaviors
-
----
-
-### 5. ✅ Removed Redundant Facing Check (MonsterFormationGroup.cs)
-
-**Location**: Line 408 (removed lines 396-400)
-
-**What Removed**:
-```csharp
-// REMOVED: This check was always true after instant rotation
-// if (!monster.IsFacingTarget(player.position, 45f))
-// {
-//     Debug.LogWarning($"[Combat] {monster.name} is not properly facing player, skipping attack");
-//     continue;
-// }
-```
-
-**Why**:
-- Line 393 does instant rotation: `FaceTarget(player.position, instant: true)`
-- Immediately after, line 396 checked if facing (always true)
-- Redundant check that never fails
-- Removed unnecessary performance overhead
-
-**Impact**: 🟢 Low - Cleanup, minor performance improvement
-
----
-
-## Testing Checklist
-
-### Detection System
-- [ ] Monsters start chasing when player enters 20f detection radius
-- [ ] Monsters stop when player exits detection zone
-- [ ] Detection triggers consistently
-
-### Direction/Rotation
-- [ ] Monsters rotate smoothly toward player during movement
-- [ ] Rotation feels natural and not jerky
-- [ ] Instant rotation works in combat (monsters face player before attacking)
-
-### Attack System
-- [ ] Only front-row monsters in range attack
-- [ ] Distant monsters in formation don't attack
-- [ ] Attack range is consistent (6.5f)
-- [ ] Monsters stop attacking when player moves away
-
-### Formation
-- [ ] Formation maintains during combat
-- [ ] No "teleporting attacks" from distant monsters
-- [ ] Back-row replacements work correctly
-
-### State Management
-- [ ] No duplicate chase/attack behaviors
-- [ ] Update() doesn't interfere with active coroutines
-- [ ] Smooth transitions between idle/chase/attack states
-
----
-
-## Configuration Options
-
-You can now adjust in Unity Inspector:
-
-### MonsterController
-- **rotationSpeed** (default: 8f) - Higher = smoother turning
-
-### MonsterFormationGroup  
-- **attackRange** (default: 6f) - Base attack range
-- **ATTACK_RANGE_BUFFER** (hardcoded: 0.5f) - Buffer added to attack range
-  - Effective range = 6.5f
-
----
-
-## Known Limitations (Not Changed)
-
-These were identified but NOT modified per "don't change much" requirement:
-
-1. **No Line-of-Sight**: Monsters detect through walls (simple sphere collider)
-2. **Sequential Attacks**: Monsters attack one-by-one with delays (not parallel)
-3. **Formation Gaps**: 2-second delay when replacing dead front-row monsters
-4. **No Terrain Awareness**: Monsters don't check for obstacles during movement
-
-These can be addressed in future updates if needed.
-
----
-
-## Summary of Impact
-
-| Change | Priority | Impact | Risk |
-|--------|----------|--------|------|
-| Rotation Speed | Low | Visual | None |
-| Per-Monster Distance | High | Gameplay | None |
-| Standardized Range | High | Consistency | None |
-| Update() Guard | Medium | Stability | None |
-| Remove Redundant Check | Low | Performance | None |
-
-**Total Changes**: 5 targeted fixes
-**Lines Modified**: ~15 lines across 2 files
-**Risk Level**: 🟢 Low - All changes are conservative and backwards compatible
-
----
-
-## Files Modified
-
-1. `/Assets/Scripts/Monsters/MonsterController.cs`
-   - Added rotation speed field
-   - Updated FaceTarget() to use configurable speed
-
-2. `/Assets/Scripts/Monsters/MonsterFormationGroup.cs`
-   - Added attack range consistency helpers
-   - Added per-monster distance check
-   - Added Update() state guards
-   - Removed redundant facing check
-   - Standardized all range checks
-
-3. `/MONSTER_DETECTION_AND_BEHAVIOR_ANALYSIS.md` (NEW)
-   - Comprehensive analysis document
-   - Identified issues and recommendations
-
----
-
-## Conclusion
-
-✅ **Detection**: Now validates individual monster proximity before attacking  
-✅ **Direction**: Smoother, configurable rotation  
-✅ **Consistency**: Unified attack range across all checks  
-✅ **Stability**: Prevented state interference  
-
-All changes are minimal, focused, and maintain existing behavior while fixing specific issues.
-
-
-
-

+ 0 - 368
RESPAWN_SYSTEM_SETUP.md

@@ -1,368 +0,0 @@
-# Player Death & Respawn System - Setup Guide
-
-## 📋 Overview
-
-A complete death and respawn system has been implemented for your dungeon crawler. The system features:
-
-- ✅ **Automatic death detection** when all party members die
-- ✅ **Smooth fade transitions** between death and respawn
-- ✅ **Checkpoint system** to save progress
-- ✅ **Death screen UI** with respawn button
-- ✅ **Full party restoration** (HP, stamina, mana)
-- ✅ **Optional penalties** (configurable)
-
----
-
-## 🎮 How It Works
-
-### Death Flow:
-1. **Character HP reaches 0** → Character dies and UI card is removed
-2. **All party members dead** → Party wipe detected
-3. **Screen fades to black** (smooth transition)
-4. **Death screen appears** with respawn button
-5. **Player clicks Respawn** → Teleports to last checkpoint
-6. **Party fully restored** → All characters revived with full HP/stamina
-7. **Fade back in** → Gameplay resumes
-
-### Checkpoint System:
-- Checkpoints save: Player position, party state, character stats
-- Respawning loads the last checkpoint
-- Initial checkpoint saved automatically 2 seconds after game start
-
----
-
-## 🛠️ Unity Setup Instructions
-
-### Step 1: Create Required GameObjects
-
-In your Unity scene hierarchy, create these GameObjects:
-
-#### 1. **GameManager** (Main Controller)
-```
-1. Create Empty GameObject: "GameManager"
-2. Add Component: GameManager.cs
-3. In Inspector, assign:
-   - Team Cohesion Manager (reference from scene)
-   - Checkpoint System (create next)
-   - Death Screen UI (create later)
-   - Player Movement (GridMovement component on player)
-4. Configure settings:
-   - Death Delay: 2 seconds (default)
-   - Respawn Fade Time: 1 second
-   - Reset Monsters On Respawn: ☐ (optional)
-   - Apply Gold Penalty: ☐ (disabled by default)
-```
-
-#### 2. **CheckpointSystem**
-```
-1. Create Empty GameObject: "CheckpointSystem"
-2. Add Component: CheckpointSystem.cs
-3. In Inspector, assign:
-   - Cohesion Manager (reference from scene)
-   - Player Transform (your player GameObject)
-   - Player Movement (GridMovement component)
-4. Settings:
-   - Auto Save On Checkpoint: ☑ (enabled)
-   - Checkpoint Radius: 3 meters
-```
-
-#### 3. **DeathScreenUI**
-```
-1. Create Empty GameObject: "DeathScreenUI"
-2. Add Component: DeathScreenUI.cs
-3. The script will auto-create the UI if not manually designed
-4. Optional: Customize death messages in Inspector array
-5. Settings:
-   - Fade In Duration: 1 second
-   - Randomize Message: ☑ (enabled)
-```
-
-### Step 2: Create Checkpoint Zones (Optional)
-
-To add checkpoint zones throughout your dungeon:
-
-```
-1. Create Empty GameObject at desired checkpoint location
-2. Name it: "Checkpoint_01" (or descriptive name)
-3. Add Component: BoxCollider
-4. Add Component: CheckpointTrigger.cs
-5. In Inspector:
-   - Box Collider: Set size (e.g., 5x3x5) and mark as Trigger
-   - Show Visual Feedback: ☑
-   - One Time Use: ☑ (recommended)
-   - Checkpoint Message: "Safe Zone Reached"
-6. Tag the object as "Checkpoint" (optional)
-```
-
-**Note:** Yellow wireframe cube shows checkpoint location in Scene view.
-
-### Step 3: Update Existing Components
-
-Your existing scripts have been updated automatically:
-- ✅ `CharacterUIController.cs` - Now notifies GameManager on party wipe
-- ✅ `GameInitializer.cs` - Saves initial checkpoint on game start
-
-### Step 4: Player Setup
-
-Ensure your Player GameObject has:
-- ✅ Tag: "Player" (important!)
-- ✅ Rigidbody or CharacterController
-- ✅ Collider for checkpoint triggers
-
-### Step 5: Testing
-
-#### Test Death:
-1. Enter Play Mode
-2. Wait 2 seconds (initial checkpoint saves)
-3. Let monsters kill all party members
-4. Death screen should appear after 2 second delay
-5. Click "RESPAWN" button
-6. Party should respawn at starting position, fully healed
-
-#### Test Checkpoint:
-1. Create a checkpoint trigger in your scene
-2. Walk player through it
-3. Console should show "Checkpoint Saved"
-4. Move away and die
-5. Should respawn at checkpoint location
-
----
-
-## ⚙️ Configuration Options
-
-### GameManager Settings:
-
-| Setting | Default | Description |
-|---------|---------|-------------|
-| Death Delay | 2s | Time before death screen appears |
-| Respawn Fade Time | 1s | Duration of fade transition |
-| Reset Monsters On Respawn | false | Respawn all monsters (harder) |
-| Apply Gold Penalty | false | Lose gold percentage on death |
-| Gold Penalty Percent | 0% | How much gold to lose |
-
-### CheckpointSystem Settings:
-
-| Setting | Default | Description |
-|---------|---------|-------------|
-| Auto Save On Checkpoint | true | Save when entering checkpoint zones |
-| Checkpoint Radius | 3m | Trigger distance for checkpoints |
-
-### CheckpointTrigger Settings:
-
-| Setting | Default | Description |
-|---------|---------|-------------|
-| Show Visual Feedback | true | Play effects on activation |
-| One Time Use | false | Only trigger once per checkpoint |
-| Checkpoint Message | Custom | Log message on save |
-
----
-
-## 🎨 Customization
-
-### Custom Death Screen UI
-
-If you want to design your own death screen instead of the auto-generated one:
-
-```
-1. Create Canvas → Panel in UI
-2. Add background image (dark/ominous)
-3. Add TextMeshPro text for death message
-4. Add Button with "RESPAWN" text
-5. Add CanvasGroup to panel
-6. Assign references in DeathScreenUI Inspector:
-   - Death Panel: Your panel GameObject
-   - Death Message Text: Your TextMeshPro text
-   - Respawn Button: Your button
-   - Canvas Group: CanvasGroup component
-```
-
-### Custom Checkpoint Visual Effects
-
-Add visual flair to checkpoints:
-
-```
-1. Create particle effect prefab (glowing portal, sparkles, etc.)
-2. Assign to CheckpointTrigger → Checkpoint VFX
-3. Add checkpoint sound effect AudioClip
-4. Effects play automatically when triggered
-```
-
-### Custom Death Penalties
-
-Enable penalties for hardcore mode:
-
-```csharp
-// In GameManager Inspector:
-Apply Gold Penalty: ☑
-Gold Penalty Percent: 10-50%
-
-// Or extend GameManager.cs to add custom penalties:
-private void ApplyGoldPenalty()
-{
-    // Your custom penalty logic
-    // Examples:
-    // - Lose items
-    // - Reduce experience
-    // - Drop equipped weapons
-}
-```
-
----
-
-## 🔧 Advanced Features
-
-### Manual Checkpoint Saving
-
-Call from your own scripts:
-
-```csharp
-// Save checkpoint at current position
-CheckpointSystem.Instance.SaveCheckpoint();
-
-// Save checkpoint at specific location
-CheckpointSystem.Instance.SaveCheckpointAt(position, rotation);
-```
-
-### Check If Player Is Dead
-
-```csharp
-if (GameManager.Instance.IsPlayerDead())
-{
-    // Disable certain features during death
-}
-```
-
-### Force Respawn
-
-```csharp
-// Trigger respawn manually
-GameManager.Instance.RespawnParty();
-```
-
----
-
-## 📝 Scene Hierarchy Example
-
-```
-Scene
-├── GameManager (GameManager.cs)
-├── CheckpointSystem (CheckpointSystem.cs)
-├── DeathScreenUI (DeathScreenUI.cs)
-├── Player
-│   └── [GridMovement, TeamCohesionManager, etc.]
-├── Canvas (UI)
-│   └── PartyUIManager
-├── Dungeon
-│   ├── Checkpoint_Entrance (CheckpointTrigger)
-│   ├── Checkpoint_MidLevel (CheckpointTrigger)
-│   └── Checkpoint_Boss (CheckpointTrigger)
-└── Monsters
-```
-
----
-
-## 🐛 Troubleshooting
-
-### Problem: Death screen doesn't appear
-**Solution:** Check that GameManager is in scene and DeathScreenUI is assigned.
-
-### Problem: Respawn doesn't restore party
-**Solution:** Ensure CheckpointSystem is assigned to GameManager and initial checkpoint was saved.
-
-### Problem: Checkpoints don't trigger
-**Solution:** 
-- Player must have "Player" tag
-- CheckpointTrigger BoxCollider must be marked as Trigger
-- CheckpointTrigger collider must be large enough
-
-### Problem: UI doesn't rebuild after respawn
-**Solution:** Make sure PartyUIManager exists in scene and is properly referenced.
-
-### Problem: Player falls through floor on respawn
-**Solution:** Ensure saved checkpoint position has valid ground underneath.
-
----
-
-## 📊 System Architecture
-
-```
-┌─────────────────┐
-│ MonsterAttack   │ Deals damage to character
-└────────┬────────┘
-         │
-         ▼
-┌─────────────────────┐
-│ CharacterUIController│ Detects HP ≤ 0
-└────────┬────────────┘
-         │
-         ▼
-┌──────────────────┐
-│ TeamCohesion     │ Checks if all dead
-│ Manager          │
-└────────┬─────────┘
-         │
-         ▼
-┌──────────────────┐
-│ GameManager      │ Orchestrates death/respawn
-└────────┬─────────┘
-         │
-         ├─► Fade to Black
-         ├─► Show Death Screen
-         └─► On Respawn Click
-                  │
-                  ▼
-          ┌──────────────────┐
-          │ CheckpointSystem │ Restore party & position
-          └──────────────────┘
-```
-
----
-
-## ✅ Quick Checklist
-
-Before testing, verify:
-
-- [ ] GameManager in scene with all references assigned
-- [ ] CheckpointSystem in scene with player reference
-- [ ] DeathScreenUI in scene (can be empty, auto-creates UI)
-- [ ] Player GameObject has "Player" tag
-- [ ] GameInitializer saves initial checkpoint
-- [ ] At least one checkpoint exists in scene (or initial checkpoint saves)
-- [ ] All scripts compiled without errors
-
----
-
-## 🎯 Next Steps
-
-**Enhancement Ideas:**
-1. Add checkpoint visual markers (glowing pillars, flags)
-2. Create safe zone audio ambiance
-3. Add "lives" system (3 respawns before game over)
-4. Implement permadeath hardcore mode
-5. Add respawn animation sequences
-6. Create checkpoint UI indicator (minimap marker)
-7. Add respawn countdown timer
-8. Implement death statistics (death counter, causes)
-
----
-
-## 📞 Support
-
-If you encounter issues:
-1. Check Unity Console for error messages (prefix: `[GameManager]`, `[CheckpointSystem]`, `[Death]`)
-2. Verify all GameObjects exist in scene hierarchy
-3. Ensure all references are assigned in Inspector
-4. Check that scripts are attached to correct GameObjects
-
-All debug logs are prefixed with system name for easy filtering.
-
----
-
-**System Version:** 1.0  
-**Created:** October 2025  
-**Compatible with:** Unity 2021.3+
-
----
-
-Enjoy your robust respawn system! 🎮✨
-