Skip to content

feat: Add Socket to props to send them to back-end#8

Merged
AyakorK merged 8 commits intodevelopfrom
feature/link_props_socket
Oct 20, 2024
Merged

feat: Add Socket to props to send them to back-end#8
AyakorK merged 8 commits intodevelopfrom
feature/link_props_socket

Conversation

@AyakorK
Copy link
Copy Markdown
Contributor

@AyakorK AyakorK commented Oct 19, 2024

Summary by CodeRabbit

  • Nouvelles Fonctionnalités

    • Ajout de nouveaux composants MonoBehaviour aux objets Player, CorridorX7, et Room pour améliorer les comportements dans le jeu.
    • Introduction d'un nouveau TrapManager pour gérer les pièges en temps réel dans les scènes TestRoom et EmptyRoom_2.
    • Ajout d'un système de gestion des propriétés avec PropsManager pour envoyer les positions des objets à un serveur.
    • Mise à jour des propriétés de transformation et des configurations des objets dans les scènes.
  • Corrections de Bugs

    • Améliorations apportées à la gestion des connexions WebSocket pour une meilleure stabilité.
  • Documentation

    • Ajout de nouveaux fichiers de métadonnées pour PropsSystem.cs et SocketManager.cs.
  • Changements de Style

    • Ajout d'un nouveau tag "Props" dans le gestionnaire de tags du projet.

@AyakorK AyakorK marked this pull request as ready for review October 19, 2024 12:28
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 19, 2024

Walkthrough

Cette demande de tirage introduit plusieurs modifications dans des fichiers de préfabriqués et de scripts au sein du projet Unity. De nouveaux composants MonoBehaviour sont ajoutés à divers préfabriqués, notamment Player, CorridorX7, et Room, augmentant ainsi leurs fonctionnalités. Des ajustements sont également apportés aux propriétés de transformation et à la gestion des objets de jeu dans les scènes EmptyRoom_2 et TestRoom. De plus, de nouvelles classes pour la gestion des sockets sont introduites, améliorant la communication réseau.

Changes

Fichier Résumé des modifications
Assets/Prefabs/Player.prefab Ajout d'un nouveau composant MonoBehaviour avec un fileID unique.
Assets/Prefabs/RoomSystem/Corridor/CorridorX7.prefab Ajout d'un nouveau composant MonoBehaviour à CorridorX7.
Assets/Prefabs/RoomSystem/Corridor/Room.prefab Ajout d'un nouveau composant MonoBehaviour et modifications des propriétés de transformation.
Assets/Scenes/EmptyRoom_2.unity Ajout et modification de plusieurs objets de jeu, y compris Map et LifeCanvas, avec des ajustements de composants.
Assets/Scenes/TestRoom.unity Ajout d'un nouvel objet de jeu TrapManager et modifications des composants existants, y compris des ajustements de Tilemap.
Assets/Scripts/Map Control/PropsSystem.cs Introduction d'une nouvelle classe PropsManager pour gérer l'envoi de positions de props à un serveur.
Assets/Scripts/SocketManager.cs Introduction d'une nouvelle classe SocketManager pour gérer la connexion WebSocket.
Assets/Scripts/Trap/TrapManager.cs Modifications dans la gestion des connexions de socket et de la fonctionnalité de placement de pièges.
ProjectSettings/TagManager.asset Ajout d'un nouveau tag "Props" dans le gestionnaire de tags.

Possibly related PRs

  • feat: Level move #7: Les modifications dans le PR principal impliquent l'ajout d'un nouveau composant MonoBehaviour au préfabriqué Player, tandis que le PR récupéré modifie également le préfabriqué Player, bien que avec un focus différent sur le composant Transform.

Suggested reviewers

  • Thomlam

🐇 Dans le jardin, les changements dansent,
Avec des pièges et des props en cadence.
Les objets de jeu s'éveillent,
De nouvelles histoires s'ensuivent,
Dans le monde de Unity, nous avançons,
Avec des rires et des bonds, nous célébrons! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@AyakorK AyakorK requested a review from Thomlam October 19, 2024 12:28
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

🧹 Outside diff range and nitpick comments (9)
ProjectSettings/TagManager.asset (1)

11-11: Ajout du tag "Props" approuvé.

L'ajout du tag "Props" est cohérent avec l'objectif de la PR d'ajouter des Sockets aux accessoires pour les envoyer au back-end.

Il serait utile de documenter brièvement le but de ce nouveau tag, peut-être dans un fichier README ou dans la documentation du projet, pour assurer une utilisation cohérente par l'équipe.

Assets/Prefabs/RoomSystem/Corridor/CorridorX7.prefab (1)

Incohérence du script MonoBehaviour référencé

Le fichier PropsSystem.cs référencé par le GUID contient une classe PropsManager au lieu de PropsSystem. Cela peut causer des problèmes de liaison dans Unity.

  • Vérifiez que le nom de la classe dans PropsSystem.cs correspond au nom du fichier.
  • Renommez la classe ou le fichier pour assurer la cohérence et permettre à Unity de lier correctement le script.
🔗 Analysis chain

Line range hint 1331-1367: Nouveau composant MonoBehaviour ajouté au préfabriqué CorridorX7.

Un nouveau composant MonoBehaviour a été ajouté au GameObject CorridorX7. Ce composant est activé et fait référence à un script via un GUID.

Veuillez vérifier les points suivants :

  1. Le but et la fonctionnalité de ce nouveau composant.
  2. Si ce composant est nécessaire pour tous les corridors ou seulement pour ce type spécifique.
  3. L'impact potentiel sur les performances ou le comportement du jeu.

Pour aider à la vérification, exécutez le script suivant pour trouver le script correspondant :

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Recherche du script correspondant au GUID
rg --type cs "9880ea29492da44c995f334244a5d19e"

Length of output: 47


Script:

#!/bin/bash
# Recherche de tous les fichiers contenant le GUID
rg "9880ea29492da44c995f334244a5d19e"

Length of output: 604


Script:

#!/bin/bash
# Afficher le contenu du fichier .meta correspondant au GUID
cat "Assets/Scripts/Map Control/PropsSystem.cs.meta"

Length of output: 297


Script:

#!/bin/bash
# Vérifier l'existence du fichier PropsSystem.cs et afficher son contenu s'il existe
if [ -f "Assets/Scripts/Map Control/PropsSystem.cs" ]; then
  cat "Assets/Scripts/Map Control/PropsSystem.cs"
else
  echo "Le fichier PropsSystem.cs est introuvable."
fi

Length of output: 3746

Assets/Scripts/SocketManager.cs (2)

24-24: Éviter l'utilisation de ConfigureAwait(false) dans le contexte Unity.

L'utilisation de ConfigureAwait(false) n'est pas nécessaire dans Unity, car le moteur Unity gère déjà le contexte de synchronisation. Cela peut être omis pour simplifier le code.

Vous pouvez modifier la ligne comme suit :

- SetupSocket().ConfigureAwait(false); // Ensure proper async handling
+ SetupSocket(); // L'appel à ConfigureAwait(false) n'est pas nécessaire dans Unity

42-42: Inclure la pile d'appels dans le message d'erreur pour faciliter le débogage.

En ajoutant e.StackTrace au journal d'erreur, vous obtiendrez des informations plus détaillées qui faciliteront le diagnostic des problèmes éventuels.

Voici comment vous pouvez modifier le code :

Debug.LogError("Socket connection error: " + e.Message);
+ Debug.LogError(e.StackTrace);
Assets/Scripts/Trap/TrapManager.cs (1)

Line range hint 38-46: Évitez d'ajouter des écouteurs d'événements dans la méthode Update

En ajoutant l'écouteur clientSocket.On("traps:place", ...) dans la méthode Update, vous créez un nouvel écouteur à chaque frame, ce qui peut entraîner des problèmes de performance et des duplications d'événements.

Il est recommandé d'initialiser le socket et d'ajouter l'écouteur une seule fois, par exemple dans la méthode Start.

 void Start()
 {
     // Initialize the grid
     grid = new string[gridSizeX, gridSizeY];

     // Map trap names to their prefabs
     trapPrefabDictionary.Add("crossbow_down_prefab", trapPrefabs[0]);
     trapPrefabDictionary.Add("crossbow_up_prefab", trapPrefabs[1]);
     trapPrefabDictionary.Add("crossbow_side_prefab", trapPrefabs[2]);

     // Set up Socket.IO client
+    clientSocket = SocketManager.Instance.ClientSocket;
+
+    clientSocket.On("traps:place", response =>
+    {
+        JArray trapDataArray = JArray.Parse(response.ToString());
+
+        foreach (var trapData in trapDataArray)
+        {
+            JObject trap = (JObject)trapData["trap"];
+
+            int x = trap["x"].Value<int>();
+            int y = trap["y"].Value<int>();
+            string trapType = trap["trapType"].Value<string>();
+
+            EnqueuePlacementOrder(x, y, trapType);
+        }
+    });
+
     StartCoroutine(ProcessPlacementQueue());
 }

-public void Update()
-{
-    clientSocket = SocketManager.Instance.ClientSocket;
-
-    clientSocket.On("traps:place", response =>
-    {
-        JArray trapDataArray = JArray.Parse(response.ToString());
-
-        foreach (var trapData in trapDataArray)
-        {
-            JObject trap = (JObject)trapData["trap"];
-
-            int x = trap["x"].Value<int>();
-            int y = trap["y"].Value<int>();
-            string trapType = trap["trapType"].Value<string>();
-
-            EnqueuePlacementOrder(x, y, trapType);
-        }
-    });
-}
Assets/Scripts/Map Control/PropsSystem.cs (3)

26-33: Gérer la reconnexion du socket

Actuellement, si le socket n'est pas connecté, le message "Socket not connected, skipping props send." est affiché, mais aucune tentative de reconnexion n'est effectuée. Pour améliorer la robustesse de l'application, envisagez d'implémenter une logique de reconnexion ou d'attendre que le socket soit disponible avant de réessayer.


80-83: Optimiser la vérification des tuiles présentes

Lors de la vérification de la présence d'une tuile avec propsTilemap.HasTile(tilePosition), il peut être plus efficace d'itérer uniquement sur les positions qui contiennent des tuiles, en utilisant propsTilemap.GetTilePositions() si disponible, pour réduire la complexité de la boucle.


117-118: Ajouter plus de détails au message d'erreur

Le message d'erreur actuel en cas d'échec de l'émission des props ne fournit que le message de l'exception. Il pourrait être utile d'inclure la pile d'appels ou des informations supplémentaires pour faciliter le débogage.

Proposition de modification :

catch (Exception e)
{
-     Debug.LogError("Failed to emit props: " + e.Message);
+     Debug.LogError("Failed to emit props: " + e.ToString());
}
Assets/Scenes/EmptyRoom_2.unity (1)

Line range hint 484-487: Le champ player dans le script n'a pas de référence assignée.

Dans le MonoBehaviour (fileID: 4842845840903471566), le champ player est vide. Cela peut provoquer des NullReferenceException si le script tente d'accéder à ce champ sans vérification préalable. Assignez le GameObject approprié au champ ou ajoutez des vérifications dans le code.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 74a6fa6 and f59fbc0.

📒 Files selected for processing (12)
  • Assets/Prefabs/Player.prefab (2 hunks)
  • Assets/Prefabs/RoomSystem/Corridor/CorridorX7.prefab (2 hunks)
  • Assets/Prefabs/RoomSystem/Corridor/Room.prefab (2 hunks)
  • Assets/Scenes/EmptyRoom_2.unity (3 hunks)
  • Assets/Scenes/TestRoom.unity (13 hunks)
  • Assets/Scripts/Map Control/PropsSystem.cs (1 hunks)
  • Assets/Scripts/Map Control/PropsSystem.cs.meta (1 hunks)
  • Assets/Scripts/PlayerController.cs (1 hunks)
  • Assets/Scripts/SocketManager.cs (1 hunks)
  • Assets/Scripts/SocketManager.cs.meta (1 hunks)
  • Assets/Scripts/Trap/TrapManager.cs (1 hunks)
  • ProjectSettings/TagManager.asset (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • Assets/Scripts/Map Control/PropsSystem.cs.meta
  • Assets/Scripts/SocketManager.cs.meta
🧰 Additional context used
🔇 Additional comments (21)
Assets/Scripts/PlayerController.cs (1)

34-34: 🛠️ Refactor suggestion

Amélioration de la gestion des sockets, mais quelques points à considérer

La modification apportée centralise la gestion des sockets via un singleton SocketManager, ce qui est une bonne pratique. Cependant, il y a quelques points à prendre en compte :

  1. Assurez-vous que SocketManager.Instance est correctement initialisé avant l'exécution de ce code.
  2. La gestion des erreurs pourrait nécessiter des ajustements, car le processus de connexion a changé.
  3. La variable socketUrl n'est plus utilisée et peut être supprimée.

Voici quelques suggestions d'amélioration :

- private string socketUrl;
  async void Start()
  {
      try
      {
-         env.TryParseEnvironmentVariable("SOCKET_URL", out string socketUrl);
-         var uri = new Uri(socketUrl);
          clientSocket = SocketManager.Instance.ClientSocket;

+         if (clientSocket == null)
+         {
+             throw new Exception("Le socket client n'a pas été initialisé correctement.");
+         }

          animator = GetComponent<Animator>();
      }
      catch (Exception e)
      {
-         //Debug.Log("Socket connection error: " + e.Message);
+         Debug.LogError("Erreur de connexion socket : " + e.Message);
      }
  }

Ces modifications permettront de :

  • Supprimer la variable inutilisée
  • Vérifier si le socket client est correctement initialisé
  • Améliorer la gestion des erreurs en utilisant Debug.LogError

Pour vérifier l'utilisation correcte de SocketManager dans le projet, exécutez le script suivant :

✅ Verification successful

Vérification réussie : La gestion centralisée des sockets est correctement implémentée

La classe SocketManager est bien définie et initialisée correctement, comme confirmé par les scripts exécutés. L'utilisation de SocketManager.Instance.ClientSocket dans PlayerController.cs et d'autres scripts assure une gestion cohérente des sockets à travers le projet. Aucune modification supplémentaire n'est requise.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Vérifier l'initialisation et l'utilisation de SocketManager

# Rechercher l'initialisation de SocketManager
echo "Recherche de l'initialisation de SocketManager :"
rg --type csharp "class SocketManager" -A 10

# Vérifier l'utilisation de SocketManager.Instance
echo "\nVérification de l'utilisation de SocketManager.Instance :"
rg --type csharp "SocketManager\.Instance"

Length of output: 1280

Assets/Prefabs/Player.prefab (3)

Line range hint 1-227: Résumé des modifications du préfabriqué Player.

Les modifications apportées au préfabriqué Player semblent minimales et bien structurées. L'ajout d'un nouveau composant MonoBehaviour pourrait potentiellement étendre les fonctionnalités du joueur, mais sans plus d'informations sur le script associé, il est difficile d'évaluer pleinement son impact.

Pour une évaluation complète, veuillez fournir des détails supplémentaires sur le nouveau script et son rôle dans le comportement du joueur. Cela nous permettra de mieux comprendre comment ces changements s'intègrent dans le contexte plus large du projet.


216-227: Configuration du nouveau composant MonoBehaviour.

Le nouveau composant MonoBehaviour semble être correctement configuré avec les paramètres par défaut. Cependant, nous n'avons pas d'informations sur le contenu ou le but du script associé.

Pouvez-vous fournir plus d'informations sur le but de ce nouveau script (guid: 9d1d8695cfa6948278518a6a55e0b730) ? Cela nous aiderait à mieux comprendre son impact sur le comportement du joueur.

Pour obtenir plus d'informations sur le script, exécutez la commande suivante :

#!/bin/bash
# Description: Afficher le contenu du script associé au nouveau composant

# Trouver le fichier de script correspondant au GUID
script_path=$(fd -e cs . ./Assets/Scripts | xargs grep -l "9d1d8695cfa6948278518a6a55e0b730" | head -n 1)

# Afficher le contenu du script s'il est trouvé
if [ -n "$script_path" ]; then
    echo "Contenu du script :"
    cat "$script_path"
else
    echo "Script non trouvé."
fi

Cela nous permettra d'examiner le contenu du script et de mieux évaluer son impact sur le préfabriqué Player.


17-17: Nouveau composant MonoBehaviour ajouté au préfabriqué Player.

Un nouveau composant MonoBehaviour a été ajouté au préfabriqué Player. Cela pourrait ajouter de nouvelles fonctionnalités ou comportements au joueur.

Pour vérifier l'impact de ce changement, exécutez le script suivant :

Ce script nous aidera à comprendre comment le nouveau composant est utilisé dans le projet.

Assets/Scripts/Trap/TrapManager.cs (1)

Line range hint 44-44: Vérifiez la présence de la clé "trap" dans trapData

Lorsque vous accédez à trapData["trap"], assurez-vous que la clé "trap" existe pour éviter des exceptions inattendues.

Pour confirmer que toutes les données reçues contiennent la clé "trap", vous pouvez ajouter une condition:

if (trapData["trap"] != null)
{
    JObject trap = (JObject)trapData["trap"];
    // ...
}
else
{
    Debug.LogWarning("La donnée reçue ne contient pas de trap.");
}
Assets/Scripts/Map Control/PropsSystem.cs (1)

15-19: Utilisation appropriée de InvokeRepeating pour vérifier la connexion du socket

La méthode Start utilise correctement InvokeRepeating pour vérifier la connexion du socket toutes les 5 secondes et envoyer les props lorsque le socket est connecté.

Assets/Scenes/EmptyRoom_2.unity (7)

Line range hint 165-192: Assurez-vous que le paramétrage des éclairages statiques est correct.

Les paramètres dans LightmapSettings indiquent que les éclairages statiques sont désactivés (m_EnableBakedLightmaps: 0 et m_EnableRealtimeLightmaps: 0). Si cela n'est pas intentionnel, veuillez vérifier les configurations pour assurer un éclairage optimal de la scène.


Line range hint 283-317: Vérifiez l'ajout du GameObject "Map" et son tag.

Le GameObject "Map" a été ajouté avec le tag "Map". Assurez-vous que ce tag est bien défini dans le gestionnaire de tags du projet Unity pour éviter des problèmes de référence ou de détection dans le code.


386-396: Vérifiez l'activation du MonoBehaviour ajouté.

Le MonoBehaviour ajouté (fileID: 791950512) est activé (m_Enabled: 1). Confirmez que cela est nécessaire et que cela ne provoque pas de comportements inattendus dans la scène.


579-581: Assurez-vous que le tag "Props" est défini.

Le tag du GameObject a été modifié en "Props". Veuillez vérifier que ce tag est bien défini dans le gestionnaire de tags Unity pour éviter des problèmes de référence.


Line range hint 880-910: Vérifiez les modifications apportées au "LifeCanvas".

Les transformations et les propriétés du "LifeCanvas" ont été modifiées, notamment la position, l'échelle et les ancres. Assurez-vous que ces modifications correspondent à la mise en page souhaitée dans l'interface utilisateur et qu'elles s'affichent correctement sur différents résolutions d'écran.


Line range hint 165-192: Paramètres de navigation non configurés.

Dans NavMeshSettings, les paramètres de navigation sont présents mais le m_NavMeshData n'est pas assigné ({fileID: 0}). Si la navigation des agents est requise dans cette scène, assurez-vous de générer les données du NavMesh.


Line range hint 519-572: Vérifiez les modifications sur le "Main Camera".

Les propriétés de la caméra principale ont été modifiées, notamment la position (m_LocalPosition: {x: 4.4, y: 3.8, z: -10}). Assurez-vous que la nouvelle position et les paramètres de projection conviennent pour l'affichage de la scène.

Assets/Prefabs/RoomSystem/Corridor/Room.prefab (1)

Line range hint 2257-2293: Vérifier la référence du script dans le MonoBehaviour ajouté

Un nouveau composant MonoBehaviour a été ajouté au GameObject Room (lignes 2257-2293) avec une référence de script via m_Script utilisant le GUID 9880ea29492da44c995f334244a5d19e. Assurez-vous que ce script existe dans le projet et que le GUID correspond bien au script attendu pour éviter des erreurs à l'exécution.

Vous pouvez exécuter le script suivant pour vérifier la présence du script avec le GUID spécifié :

✅ Verification successful

Vérification de la référence du script réussie

Le script avec le GUID 9880ea29492da44c995f334244a5d19e existe dans Assets/Scripts/Map Control/PropsSystem.cs. La référence dans le MonoBehaviour ajouté est correcte.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description : Vérifier l'existence du script avec le GUID spécifié

# Recherche des fichiers .meta contenant le GUID
rg 'guid: 9880ea29492da44c995f334244a5d19e' --glob '*.meta'

Length of output: 147

Assets/Scenes/TestRoom.unity (7)

200-200: Vérifier l'utilisation du tag 'Props'

Le GameObject 'Props' a son 'm_TagString' modifié en 'Props'. Assurez-vous que ce tag est bien défini dans votre projet et qu'il est utilisé de manière cohérente pour éviter des problèmes lors de la recherche ou du filtrage des objets par tag.


296-296: Confirmer la modification de 'm_SortingOrder'

Le 'm_SortingOrder' du 'TilemapRenderer' du GameObject 'Props' a été changé de '2' à '10'. Vérifiez que cette modification est intentionnelle et qu'elle n'affecte pas l'ordre de rendu des autres éléments de la scène.


485-485: Confirmer la nouvelle taille du Tilemap de 'Floor'

La propriété 'm_Size' du Tilemap de 'Floor' a été modifiée à {x: 9, y: 9, z: 1}. Assurez-vous que cette dimension correspond bien à vos attentes pour l'agencement du sol dans la scène.


1074-1075: Vérifier la cohérence des indices de tiles

Les valeurs de 'm_TileIndex' et 'm_TileSpriteIndex' ont été changées. Assurez-vous que ces indices correspondent aux tiles corrects dans votre tileset pour éviter des affichages inattendus.


1543-1544: Nouvelle entrée dans 'm_TileAssetArray'

Une nouvelle référence a été ajoutée dans 'm_TileAssetArray'. Veuillez confirmer que l'asset référencé existe et est correctement importé dans le projet pour éviter des erreurs au moment de l'exécution.


2900-2947: Ajout du GameObject 'TrapManager' avec ses composants

Un nouveau GameObject 'TrapManager' a été ajouté, comprenant un MonoBehaviour avec une liste 'trapPrefabs'. Vérifiez que tous les prefabs référencés dans 'trapPrefabs' sont disponibles et fonctionnent comme prévu.


3594-3594: Intégration de 'TrapManager' dans 'SceneRoots'

Le 'TrapManager' a été ajouté à la section 'SceneRoots'. Assurez-vous que sa position dans la hiérarchie de la scène est correcte et qu'il n'interfère pas avec d'autres objets ou scripts existants.

Comment on lines +32 to +33
env.TryParseEnvironmentVariable("SOCKET_URL", out string socketUrl);
var uri = new Uri(socketUrl);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Vérifier que 'SOCKET_URL' est défini avant de créer l'URI pour éviter des exceptions.

Si la variable d'environnement SOCKET_URL n'est pas définie ou est vide, la création d'une nouvelle Uri avec une chaîne nulle ou vide provoquera une exception. Il est important de vérifier que socketUrl est valide avant de l'utiliser.

Vous pouvez ajouter une vérification comme suit :

env.TryParseEnvironmentVariable("SOCKET_URL", out string socketUrl);
+ if (string.IsNullOrEmpty(socketUrl))
+ {
+     Debug.LogError("La variable d'environnement 'SOCKET_URL' n'est pas définie ou est vide.");
+     return;
+ }
var uri = new Uri(socketUrl);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
env.TryParseEnvironmentVariable("SOCKET_URL", out string socketUrl);
var uri = new Uri(socketUrl);
env.TryParseEnvironmentVariable("SOCKET_URL", out string socketUrl);
if (string.IsNullOrEmpty(socketUrl))
{
Debug.LogError("La variable d'environnement 'SOCKET_URL' n'est pas définie ou est vide.");
return;
}
var uri = new Uri(socketUrl);

Comment on lines +16 to +19
if (_instance != null && _instance != this)
{
Destroy(this.gameObject);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Corriger l'implémentation du modèle Singleton pour éviter des problèmes potentiels.

L'appel à Destroy(this.gameObject); dans la méthode Awake peut causer des comportements inattendus. Il est préférable d'utiliser Destroy(gameObject); sans le préfixe this. De plus, assurez-vous que le modèle Singleton est correctement implémenté pour éviter les duplications d'instances.

Vous pouvez modifier le code comme suit :

private void Awake()
{
    if (_instance != null && _instance != this)
    {
-       Destroy(this.gameObject);
+       Destroy(gameObject);
    }
    else
    {
        _instance = this;
        DontDestroyOnLoad(gameObject); // Keep the socket alive across scenes
        SetupSocket().ConfigureAwait(false); // Ensure proper async handling
    }
}

Committable suggestion was skipped due to low confidence.


public void Update()
{
clientSocket = SocketManager.Instance.ClientSocket;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Assurez-vous que clientSocket est correctement initialisé

En affectant clientSocket = SocketManager.Instance.ClientSocket dans la méthode Update, vous risquez de réaffecter le client socket à chaque frame. Si le client socket ne change pas pendant l'exécution, il est préférable de l'initialiser une seule fois dans la méthode Start.

Déplacez l'initialisation de clientSocket dans la méthode Start:

 void Start()
 {
     // Initialize the grid
     grid = new string[gridSizeX, gridSizeY];

     // Map trap names to their prefabs
     trapPrefabDictionary.Add("crossbow_down_prefab", trapPrefabs[0]);
     trapPrefabDictionary.Add("crossbow_up_prefab", trapPrefabs[1]);
     trapPrefabDictionary.Add("crossbow_side_prefab", trapPrefabs[2]);

     // Set up Socket.IO client
+    clientSocket = SocketManager.Instance.ClientSocket;

     StartCoroutine(ProcessPlacementQueue());
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
clientSocket = SocketManager.Instance.ClientSocket;
void Start()
{
// Initialize the grid
grid = new string[gridSizeX, gridSizeY];
// Map trap names to their prefabs
trapPrefabDictionary.Add("crossbow_down_prefab", trapPrefabs[0]);
trapPrefabDictionary.Add("crossbow_up_prefab", trapPrefabs[1]);
trapPrefabDictionary.Add("crossbow_side_prefab", trapPrefabs[2]);
// Set up Socket.IO client
clientSocket = SocketManager.Instance.ClientSocket;
StartCoroutine(ProcessPlacementQueue());
}

Comment on lines +110 to +114
Debug.Log("Emitting props to server...");
await clientSocket.EmitAsync("rooms:create", propsPositionsString);
PropsSent = true;
Debug.Log("Props successfully sent to server.");
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Vérifier le format des données envoyées au serveur

L'envoi d'une liste de chaînes de caractères représentant les positions pourrait limiter la flexibilité côté serveur. Il serait plus efficace d'envoyer les données sous forme d'objets sérialisés (par exemple, en JSON) pour faciliter le traitement et l'évolutivité.

Proposition de modification :

  • Sérialiser les positions en un objet JSON avant l'envoi.
  • Modifier l'appel à EmitAsync pour envoyer l'objet sérialisé.

Comment on lines +92 to +104
private List<string> ConvertPositionsToString(List<Vector3> propsPositions)
{
List<string> propsPositionsString = new List<string>();

foreach (Vector3 position in propsPositions)
{
string positionString = $"{position.x}, {position.y}";
propsPositionsString.Add(positionString);
}

return propsPositionsString;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Mettre à jour ConvertPositionsToString pour accepter List<Vector3Int>

Suite à la modification du type de propsPositions, la méthode ConvertPositionsToString doit être mise à jour pour accepter une List<Vector3Int> au lieu de List<Vector3>.

Appliquez cette modification :

- private List<string> ConvertPositionsToString(List<Vector3> propsPositions)
+ private List<string> ConvertPositionsToString(List<Vector3Int> propsPositions)
{
    List<string> propsPositionsString = new List<string>();

    foreach (Vector3Int position in propsPositions)
    {
        string positionString = $"{position.x}, {position.y}";
        propsPositionsString.Add(positionString);
    }
    return propsPositionsString;
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private List<string> ConvertPositionsToString(List<Vector3> propsPositions)
{
List<string> propsPositionsString = new List<string>();
foreach (Vector3 position in propsPositions)
{
string positionString = $"{position.x}, {position.y}";
propsPositionsString.Add(positionString);
}
return propsPositionsString;
}
private List<string> ConvertPositionsToString(List<Vector3Int> propsPositions)
{
List<string> propsPositionsString = new List<string>();
foreach (Vector3Int position in propsPositions)
{
string positionString = $"{position.x}, {position.y}";
propsPositionsString.Add(positionString);
}
return propsPositionsString;
}

// Find the grid and the props tilemap, then send props positions to the server
private async Task FindAndSendProps()
{
GameObject grid = GameObject.Find("Grid");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Évitez l'utilisation de GameObject.Find pour des performances optimales

L'utilisation de GameObject.Find("Grid") peut être inefficace dans les scènes comportant de nombreux objets. Il est recommandé de référencer directement le GameObject Grid via l'inspecteur ou de le passer en paramètre pour améliorer les performances et éviter les recherches coûteuses.

Proposition de modification :

+ public GameObject grid;

private async Task FindAndSendProps()
{
-     GameObject grid = GameObject.Find("Grid");

Ainsi, vous pouvez assigner le GameObject Grid depuis l'inspecteur et supprimer l'appel à GameObject.Find.

Committable suggestion was skipped due to low confidence.

Comment on lines +69 to +89
private List<Vector3> GetPropsPositions()
{
BoundsInt bounds = propsTilemap.cellBounds;
List<Vector3> propsPositions = new List<Vector3>();

for (int x = bounds.xMin; x < bounds.xMax; x++)
{
for (int y = bounds.yMin; y < bounds.yMax; y++)
{
Vector3Int tilePosition = new Vector3Int(x, y, 0);

if (propsTilemap.HasTile(tilePosition))
{
propsPositions.Add(tilePosition);
}
}
}

Debug.Log($"Total props found: {propsPositions.Count}");
return propsPositions;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Corriger le type de la liste propsPositions pour utiliser Vector3Int

La méthode GetPropsPositions déclare une liste de Vector3, mais ajoute des éléments de type Vector3Int. Pour éviter des conversions implicites et garantir la précision des positions sur la grille, il est préférable d'utiliser List<Vector3Int>.

Appliquez cette modification :

- private List<Vector3> GetPropsPositions()
+ private List<Vector3Int> GetPropsPositions()
{
-     List<Vector3> propsPositions = new List<Vector3>();
+     List<Vector3Int> propsPositions = new List<Vector3Int>();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private List<Vector3> GetPropsPositions()
{
BoundsInt bounds = propsTilemap.cellBounds;
List<Vector3> propsPositions = new List<Vector3>();
for (int x = bounds.xMin; x < bounds.xMax; x++)
{
for (int y = bounds.yMin; y < bounds.yMax; y++)
{
Vector3Int tilePosition = new Vector3Int(x, y, 0);
if (propsTilemap.HasTile(tilePosition))
{
propsPositions.Add(tilePosition);
}
}
}
Debug.Log($"Total props found: {propsPositions.Count}");
return propsPositions;
}
private List<Vector3Int> GetPropsPositions()
{
BoundsInt bounds = propsTilemap.cellBounds;
List<Vector3Int> propsPositions = new List<Vector3Int>();
for (int x = bounds.xMin; x < bounds.xMax; x++)
{
for (int y = bounds.yMin; y < bounds.yMax; y++)
{
Vector3Int tilePosition = new Vector3Int(x, y, 0);
if (propsTilemap.HasTile(tilePosition))
{
propsPositions.Add(tilePosition);
}
}
}
Debug.Log($"Total props found: {propsPositions.Count}");
return propsPositions;
}

Comment on lines +380 to +395
--- !u!1 &791950511 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6459706332820108789, guid: 35bed5d2a54129845bcff6b3abaa746b, type: 3}
m_PrefabInstance: {fileID: 1166055672053893236}
m_PrefabAsset: {fileID: 0}
--- !u!114 &791950512
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 791950511}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9880ea29492da44c995f334244a5d19e, type: 3}
m_Name:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Le composant MonoBehaviour manque potentiellement son script associé.

Dans le MonoBehaviour (fileID: 791950512), le script référencé peut être manquant ou incorrect (m_Script avec guid: 9880ea29492da44c995f334244a5d19e). Assurez-vous que le script correspondant est présent dans le projet et que le GUID est correct.

Comment on lines +595 to +597
- targetCorrespondingSourceObject: {fileID: 6459706332820108789, guid: 35bed5d2a54129845bcff6b3abaa746b, type: 3}
insertIndex: -1
addedObject: {fileID: 791950512}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Nouveau composant ajouté sans référence de script.

Un composant a été ajouté au GameObject (fileID: 6459706332820108789) sans référence de script associée. Cela peut entraîner des erreurs à l'exécution. Assurez-vous que le script nécessaire est correctement assigné.

Comment thread Assets/Scenes/TestRoom.unity
Copy link
Copy Markdown
Contributor

@Thomlam Thomlam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for merge, check after if trapsystem is good

@AyakorK AyakorK closed this Oct 20, 2024
@AyakorK AyakorK reopened this Oct 20, 2024
@AyakorK AyakorK merged commit cff8842 into develop Oct 20, 2024
@AyakorK AyakorK deleted the feature/link_props_socket branch October 20, 2024 11:29
AyakorK added a commit that referenced this pull request Oct 20, 2024
* feat: Level move (#7)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* fix(level_move): Replace hard-coded values ​​with variables for better flexibility

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add Socket to props to send them to back-end (#8)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* feat: Add link to props using sockets

* feat: Add a unique socket system manager

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Thomlam added a commit that referenced this pull request Oct 20, 2024
* merge: Merge develop to menu (#9)

* feat: Level move (#7)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* fix(level_move): Replace hard-coded values ​​with variables for better flexibility

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add Socket to props to send them to back-end (#8)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* feat: Add link to props using sockets

* feat: Add a unique socket system manager

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: Remove duplication of code

* fix: Fix Idle animation

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
AyakorK added a commit that referenced this pull request Oct 21, 2024
* merge: Merge menu and develop and fix little issues (#10)

* merge: Merge develop to menu (#9)

* feat: Level move (#7)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* fix(level_move): Replace hard-coded values ​​with variables for better flexibility

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add Socket to props to send them to back-end (#8)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* feat: Add link to props using sockets

* feat: Add a unique socket system manager

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: Remove duplication of code

* fix: Fix Idle animation

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* revert: Revert changes from EmptyRoom that breaked doors

* feat:Some menu option had

* feat: Add pause system, return to menu and restart game, fix OnLoadScene in unity for hard reset player state

* chore: remove commentary for trap manager

---------

Co-authored-by: Guillaume MORET <90462045+AyakorK@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: AyakorK <guillaume.moret@yahoo.com>
@coderabbitai coderabbitai Bot mentioned this pull request Oct 21, 2024
Thomlam added a commit that referenced this pull request Oct 22, 2024
* merge: Merge menu and develop and fix little issues (#10)

* merge: Merge develop to menu (#9)

* feat: Level move (#7)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* fix(level_move): Replace hard-coded values ​​with variables for better flexibility

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add Socket to props to send them to back-end (#8)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* feat: Add link to props using sockets

* feat: Add a unique socket system manager

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: Remove duplication of code

* fix: Fix Idle animation

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* revert: Revert changes from EmptyRoom that breaked doors

* feat: V1.0 of WaitingScreen

* fix: Fix the way of sending props and remove the SocketManager from the player

* fix: Remove the Socket when leaving to the menu

* feat: Add the SocketManager to the Menu

* fix: Fix player animation and options text

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Thomlam added a commit that referenced this pull request Oct 23, 2024
* Feature/initialization (#1)

* feature: Init repository

* chore: add git ignore

* chore: Upgrade .gitignore

* chore: Remove all ignored files

* chore: Removed all files that are in the .gitignore

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

* docs: Update README.md

* Feature/global map (#3)

* feature: Add Timelap and player

* fix: fix error with tilemap

* feat: First version of Player Movements

* feat: First version of animation of the player movements

* fix: Update Player prefab to add the animator

* feat: Add collisions + modify player prefab

* chore: Remove useless folder Art

* feature: Add socket connection and linking it to the back-end

* fix(player_movement): Fix call between backend and game

* feature: Ajout de nombreux assets, modifications de la taille, découpage assets

* fix: Global Fixes about the blurring of the components imported

* feat: Add first rooms

* fix: Fix animations and player asset

* feat: Create Third room

* fix: Reduce player's hitbox

* feature: Ajouts des systèmes de pièges, connections et manager des pièges, animations de la crossbow, ajouts des sprites de l'arrow et de ces effets puis damages, changements tags du joueurs et des walls, changement et ajouts des systèmes de vie du joueurs, changements première phase de l'ui et création de celui-ci

* fix: compression des images retirer

* revert: Revert changes on the ground.png.meta

* revert: Revert changes made on the furnitures

* fix: Fix position of map 1 and player collision

* fix: Fix rooms placement

* fix: Fix arrow physics

* feature: Add doors and animations

* feature: add door system end remove multiple commentary

---------

Co-authored-by: AyakorK <guillaume.moret@yahoo.com>
Co-authored-by: Loule | Louis <35641311+Loule95450@users.noreply.github.com>

* Feature/addition of corridors (#4)

* feature: Add Timelap and player

* fix: fix error with tilemap

* feat: First version of Player Movements

* feat: First version of animation of the player movements

* fix: Update Player prefab to add the animator

* feat: Add collisions + modify player prefab

* chore: Remove useless folder Art

* feature: Add socket connection and linking it to the back-end

* fix(player_movement): Fix call between backend and game

* feature: Ajout de nombreux assets, modifications de la taille, découpage assets

* fix: Global Fixes about the blurring of the components imported

* feat: Add first rooms

* fix: Fix animations and player asset

* feat: Create Third room

* fix: Reduce player's hitbox

* feature: Ajouts des systèmes de pièges, connections et manager des pièges, animations de la crossbow, ajouts des sprites de l'arrow et de ces effets puis damages, changements tags du joueurs et des walls, changement et ajouts des systèmes de vie du joueurs, changements première phase de l'ui et création de celui-ci

* fix: compression des images retirer

* revert: Revert changes on the ground.png.meta

* revert: Revert changes made on the furnitures

* fix: Fix position of map 1 and player collision

* fix: Fix rooms placement

* fix: Fix arrow physics

* feature: Add doors and animations

* feat: Addition of corridors

* feature: add door system end remove multiple commentary

---------

Co-authored-by: AyakorK <guillaume.moret@yahoo.com>
Co-authored-by: Loule | Louis <35641311+Loule95450@users.noreply.github.com>

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Add Menu system, update styling

* feat: Add Dialog system, add multiple coroutine for enable or disable dialog box

* feat: Level move (#7)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* fix(level_move): Replace hard-coded values ​​with variables for better flexibility

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add and fix prefab, add DevRoom prefab

* fix: fix door

* feat: Add Socket to props to send them to back-end (#8)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* feat: Add link to props using sockets

* feat: Add a unique socket system manager

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

* hotfix: Delete code duplication

* Feature/menu (#11)

* merge: Merge menu and develop and fix little issues (#10)

* merge: Merge develop to menu (#9)

* feat: Level move (#7)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* fix(level_move): Replace hard-coded values ​​with variables for better flexibility

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add Socket to props to send them to back-end (#8)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* feat: Add link to props using sockets

* feat: Add a unique socket system manager

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: Remove duplication of code

* fix: Fix Idle animation

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* revert: Revert changes from EmptyRoom that breaked doors

* feat:Some menu option had

* feat: Add pause system, return to menu and restart game, fix OnLoadScene in unity for hard reset player state

* chore: remove commentary for trap manager

---------

Co-authored-by: Guillaume MORET <90462045+AyakorK@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: AyakorK <guillaume.moret@yahoo.com>

* fix: remove duplicata room

* feat: Add a visual timer prefab (V.1.0) (#12)

Co-authored-by: AyakorK <guillaume.moret@yahoo.com>

* feat: Add dynamic environment interaction system and new events (#13)

- Implement player interaction system with the environment
- Add dynamic room system:
  - Events now added based on room number and corridor-specific stages
  - Dynamic event generation based on the current floor
- New events added:
  - "Blacksmith"
  - "Altar" event allowing players to take one item
- Introduced IsCorridor detection system for dynamic instantiation and removal of corridor events
- Enhance item saving system to persist data across rooms, including inventory, dialogues, and more
- Implement full inventory system
- Add multiple UI elements, animations, and canvas for visual feedback

* fix: add removed line

* feat: Add waiting screen and fix some behaviors (#14)

* merge: Merge menu and develop and fix little issues (#10)

* merge: Merge develop to menu (#9)

* feat: Level move (#7)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* fix(level_move): Replace hard-coded values ​​with variables for better flexibility

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add Socket to props to send them to back-end (#8)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* feat: Add link to props using sockets

* feat: Add a unique socket system manager

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: Remove duplication of code

* fix: Fix Idle animation

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* revert: Revert changes from EmptyRoom that breaked doors

* feat: V1.0 of WaitingScreen

* fix: Fix the way of sending props and remove the SocketManager from the player

* fix: Remove the Socket when leaving to the menu

* feat: Add the SocketManager to the Menu

* fix: Fix player animation and options text

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add trap persistance through rooms (#15)

* feat: Camera Control & Room enlargement (#16)

* feat: Try to update the camera of the user (a bit of a disaster by now)

* fix: Add good tracker Y limit for camera move, synch HUD with camera move

* fix: Fix the camera adapting to the scene

* feat: Get the room bigger

---------

Co-authored-by: Thomlam <lamiablethomas@gmail.com>

* feat: Modify the new room (#17)

* fix: Add a missing pillar

* fix: Crossbow positions (#18)

* fix: Fix the placement of the crossbows

* feat: Add hitboxes to crossbows

* fix: Remove useless traps spawns

* fix: Reorder correctly the crossbow prefabs

* Feature/add traps (#19)

* feature: Update some animations and system for the player, and add new trap

* feat: update EmptyRoom2 for test

---------

Co-authored-by: Guillaume MORET <90462045+AyakorK@users.noreply.github.com>

---------

Co-authored-by: Loule | Louis <35641311+Loule95450@users.noreply.github.com>
Co-authored-by: AyakorK <guillaume.moret@yahoo.com>
Co-authored-by: Guillaume MORET <90462045+AyakorK@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Loule95450 added a commit that referenced this pull request Oct 23, 2024
* Feature/initialization (#1)

* feature: Init repository

* chore: add git ignore

* chore: Upgrade .gitignore

* chore: Remove all ignored files

* chore: Removed all files that are in the .gitignore

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

* docs: Update README.md

* Feature/global map (#3)

* feature: Add Timelap and player

* fix: fix error with tilemap

* feat: First version of Player Movements

* feat: First version of animation of the player movements

* fix: Update Player prefab to add the animator

* feat: Add collisions + modify player prefab

* chore: Remove useless folder Art

* feature: Add socket connection and linking it to the back-end

* fix(player_movement): Fix call between backend and game

* feature: Ajout de nombreux assets, modifications de la taille, découpage assets

* fix: Global Fixes about the blurring of the components imported

* feat: Add first rooms

* fix: Fix animations and player asset

* feat: Create Third room

* fix: Reduce player's hitbox

* feature: Ajouts des systèmes de pièges, connections et manager des pièges, animations de la crossbow, ajouts des sprites de l'arrow et de ces effets puis damages, changements tags du joueurs et des walls, changement et ajouts des systèmes de vie du joueurs, changements première phase de l'ui et création de celui-ci

* fix: compression des images retirer

* revert: Revert changes on the ground.png.meta

* revert: Revert changes made on the furnitures

* fix: Fix position of map 1 and player collision

* fix: Fix rooms placement

* fix: Fix arrow physics

* feature: Add doors and animations

* feature: add door system end remove multiple commentary

---------

Co-authored-by: AyakorK <guillaume.moret@yahoo.com>
Co-authored-by: Loule | Louis <35641311+Loule95450@users.noreply.github.com>

* Feature/addition of corridors (#4)

* feature: Add Timelap and player

* fix: fix error with tilemap

* feat: First version of Player Movements

* feat: First version of animation of the player movements

* fix: Update Player prefab to add the animator

* feat: Add collisions + modify player prefab

* chore: Remove useless folder Art

* feature: Add socket connection and linking it to the back-end

* fix(player_movement): Fix call between backend and game

* feature: Ajout de nombreux assets, modifications de la taille, découpage assets

* fix: Global Fixes about the blurring of the components imported

* feat: Add first rooms

* fix: Fix animations and player asset

* feat: Create Third room

* fix: Reduce player's hitbox

* feature: Ajouts des systèmes de pièges, connections et manager des pièges, animations de la crossbow, ajouts des sprites de l'arrow et de ces effets puis damages, changements tags du joueurs et des walls, changement et ajouts des systèmes de vie du joueurs, changements première phase de l'ui et création de celui-ci

* fix: compression des images retirer

* revert: Revert changes on the ground.png.meta

* revert: Revert changes made on the furnitures

* fix: Fix position of map 1 and player collision

* fix: Fix rooms placement

* fix: Fix arrow physics

* feature: Add doors and animations

* feat: Addition of corridors

* feature: add door system end remove multiple commentary

---------

Co-authored-by: AyakorK <guillaume.moret@yahoo.com>
Co-authored-by: Loule | Louis <35641311+Loule95450@users.noreply.github.com>

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Add Menu system, update styling

* feat: Add Dialog system, add multiple coroutine for enable or disable dialog box

* feat: Level move (#7)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* fix(level_move): Replace hard-coded values ​​with variables for better flexibility

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add and fix prefab, add DevRoom prefab

* fix: fix door

* feat: Add Socket to props to send them to back-end (#8)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* feat: Add link to props using sockets

* feat: Add a unique socket system manager

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

* hotfix: Delete code duplication

* Feature/menu (#11)

* merge: Merge menu and develop and fix little issues (#10)

* merge: Merge develop to menu (#9)

* feat: Level move (#7)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* fix(level_move): Replace hard-coded values ​​with variables for better flexibility

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add Socket to props to send them to back-end (#8)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* feat: Add link to props using sockets

* feat: Add a unique socket system manager

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: Remove duplication of code

* fix: Fix Idle animation

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* revert: Revert changes from EmptyRoom that breaked doors

* feat:Some menu option had

* feat: Add pause system, return to menu and restart game, fix OnLoadScene in unity for hard reset player state

* chore: remove commentary for trap manager

---------

Co-authored-by: Guillaume MORET <90462045+AyakorK@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: AyakorK <guillaume.moret@yahoo.com>

* fix: remove duplicata room

* feat: Add a visual timer prefab (V.1.0) (#12)

Co-authored-by: AyakorK <guillaume.moret@yahoo.com>

* feat: Add dynamic environment interaction system and new events (#13)

- Implement player interaction system with the environment
- Add dynamic room system:
  - Events now added based on room number and corridor-specific stages
  - Dynamic event generation based on the current floor
- New events added:
  - "Blacksmith"
  - "Altar" event allowing players to take one item
- Introduced IsCorridor detection system for dynamic instantiation and removal of corridor events
- Enhance item saving system to persist data across rooms, including inventory, dialogues, and more
- Implement full inventory system
- Add multiple UI elements, animations, and canvas for visual feedback

* fix: add removed line

* feat: Add waiting screen and fix some behaviors (#14)

* merge: Merge menu and develop and fix little issues (#10)

* merge: Merge develop to menu (#9)

* feat: Level move (#7)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* fix(level_move): Replace hard-coded values ​​with variables for better flexibility

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add Socket to props to send them to back-end (#8)

* feature: First try to add level move in Unity

* feat: fix Arrow, upgrade door system

* feat: Fix multiple problem

* fix: fix door teleport with disable player public selected

* feat: Addition of traps using sockets (#6)

* feat: Add auto implementation from website of traps

* chore: Add environment variables to UnityProject (#5)

* fix: Remove useless Log that was crashed

* feat: Add link to props using sockets

* feat: Add a unique socket system manager

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: Remove duplication of code

* fix: Fix Idle animation

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* revert: Revert changes from EmptyRoom that breaked doors

* feat: V1.0 of WaitingScreen

* fix: Fix the way of sending props and remove the SocketManager from the player

* fix: Remove the Socket when leaving to the menu

* feat: Add the SocketManager to the Menu

* fix: Fix player animation and options text

---------

Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: Add trap persistance through rooms (#15)

* feat: Camera Control & Room enlargement (#16)

* feat: Try to update the camera of the user (a bit of a disaster by now)

* fix: Add good tracker Y limit for camera move, synch HUD with camera move

* fix: Fix the camera adapting to the scene

* feat: Get the room bigger

---------

Co-authored-by: Thomlam <lamiablethomas@gmail.com>

* feat: Modify the new room (#17)

* fix: Add a missing pillar

* fix: Crossbow positions (#18)

* fix: Fix the placement of the crossbows

* feat: Add hitboxes to crossbows

* fix: Remove useless traps spawns

* fix: Reorder correctly the crossbow prefabs

* Feature/add traps (#19)

* feature: Update some animations and system for the player, and add new trap

* feat: update EmptyRoom2 for test

---------

Co-authored-by: Guillaume MORET <90462045+AyakorK@users.noreply.github.com>

* fix: Trap management & improvements (#21)

* fix: Enlarge the gridSizeY to match the room and modify the level of the floor to fix traps

* feat: Improve doors and room and traps

* feat: Add walls on first room

* feat: Add bear_trap to trap manager

* hotfix: Remove bear_trap from the EmptyRoom

---------

Co-authored-by: Loule | Louis <35641311+Loule95450@users.noreply.github.com>
Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com>
Co-authored-by: Thomas Lamiable <86667484+Thomlam@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants