feat: Add Socket to props to send them to back-end#8
Conversation
* feat: Add auto implementation from website of traps * chore: Add environment variables to UnityProject (#5) * fix: Remove useless Log that was crashed
WalkthroughCette demande de tirage introduit plusieurs modifications dans des fichiers de préfabriqués et de scripts au sein du projet Unity. De nouveaux composants Changes
Possibly related PRs
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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.csréférencé par le GUID contient une classePropsManagerau lieu dePropsSystem. Cela peut causer des problèmes de liaison dans Unity.
- Vérifiez que le nom de la classe dans
PropsSystem.cscorrespond 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 :
- Le but et la fonctionnalité de ce nouveau composant.
- Si ce composant est nécessaire pour tous les corridors ou seulement pour ce type spécifique.
- 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." fiLength of output: 3746
Assets/Scripts/SocketManager.cs (2)
24-24: Éviter l'utilisation deConfigureAwait(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.StackTraceau 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éthodeUpdateEn ajoutant l'écouteur
clientSocket.On("traps:place", ...)dans la méthodeUpdate, 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 socketActuellement, 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ésentesLors 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 utilisantpropsTilemap.GetTilePositions()si disponible, pour réduire la complexité de la boucle.
117-118: Ajouter plus de détails au message d'erreurLe 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 champplayerdans le script n'a pas de référence assignée.Dans le
MonoBehaviour(fileID: 4842845840903471566), le champplayerest vide. Cela peut provoquer desNullReferenceExceptionsi 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
📒 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 suggestionAmé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 :
- Assurez-vous que
SocketManager.Instanceest correctement initialisé avant l'exécution de ce code.- La gestion des erreurs pourrait nécessiter des ajustements, car le processus de connexion a changé.
- La variable
socketUrln'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.LogErrorPour vérifier l'utilisation correcte de
SocketManagerdans 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
SocketManagerest bien définie et initialisée correctement, comme confirmé par les scripts exécutés. L'utilisation deSocketManager.Instance.ClientSocketdansPlayerController.cset 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é." fiCela 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" danstrapDataLorsque 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 socketLa méthode
Startutilise correctementInvokeRepeatingpour 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
LightmapSettingsindiquent que les éclairages statiques sont désactivés (m_EnableBakedLightmaps: 0etm_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 duMonoBehaviourajouté.Le
MonoBehaviourajouté (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 lem_NavMeshDatan'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
MonoBehavioura été ajouté au GameObjectRoom(lignes 2257-2293) avec une référence de script viam_Scriptutilisant le GUID9880ea29492da44c995f334244a5d19e. 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
9880ea29492da44c995f334244a5d19eexiste dansAssets/Scripts/Map Control/PropsSystem.cs. La référence dans leMonoBehaviourajouté 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 tilesLes 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 composantsUn 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.
| env.TryParseEnvironmentVariable("SOCKET_URL", out string socketUrl); | ||
| var uri = new Uri(socketUrl); |
There was a problem hiding this comment.
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.
| 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); |
| if (_instance != null && _instance != this) | ||
| { | ||
| Destroy(this.gameObject); | ||
| } |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
🛠️ 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.
| 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()); | |
| } |
| Debug.Log("Emitting props to server..."); | ||
| await clientSocket.EmitAsync("rooms:create", propsPositionsString); | ||
| PropsSent = true; | ||
| Debug.Log("Props successfully sent to server."); | ||
| } |
There was a problem hiding this comment.
🛠️ 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 à
EmitAsyncpour envoyer l'objet sérialisé.
| 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; | ||
| } | ||
|
|
There was a problem hiding this comment.
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.
| 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"); |
There was a problem hiding this comment.
🛠️ 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.
| 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; | ||
| } |
There was a problem hiding this comment.
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.
| 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; | |
| } |
| --- !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: |
There was a problem hiding this comment.
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.
| - targetCorrespondingSourceObject: {fileID: 6459706332820108789, guid: 35bed5d2a54129845bcff6b3abaa746b, type: 3} | ||
| insertIndex: -1 | ||
| addedObject: {fileID: 791950512} |
There was a problem hiding this comment.
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é.
Thomlam
left a comment
There was a problem hiding this comment.
OK for merge, check after if trapsystem is good
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
Summary by CodeRabbit
Nouvelles Fonctionnalités
MonoBehaviouraux objetsPlayer,CorridorX7, etRoompour améliorer les comportements dans le jeu.TrapManagerpour gérer les pièges en temps réel dans les scènesTestRoometEmptyRoom_2.PropsManagerpour envoyer les positions des objets à un serveur.Corrections de Bugs
Documentation
PropsSystem.csetSocketManager.cs.Changements de Style