Conversation
WalkthroughLes modifications apportées dans cette demande de tirage concernent principalement des fichiers de préfabriqués et de scripts dans un projet Unity. Des objets de jeu tels que Changes
Possibly related PRs
Suggested reviewers
Poem
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: 7
🧹 Outside diff range and nitpick comments (7)
Assets/Prefabs/RoomSystem/WaitingRoom.prefab (1)
Le tag "Temporary" semble être une anomalie dans le système de salles
D'après l'analyse du code, le tag "Temporary" n'est utilisé que dans deux fichiers : le prefab WaitingRoom et la scène Menu. Dans le contexte du système de salles, les autres prefabs utilisent des tags plus descriptifs et appropriés comme "Wall", "Map", "Door", "SpawnPoint", "Props" et "Respawn". Le tag "Temporary" ne semble pas cohérent avec cette nomenclature établie.
- Le tag devrait être changé pour mieux refléter le rôle de ce GameObject dans le système de salles
- Considérez utiliser un tag plus approprié comme "Room" ou un tag similaire aux autres prefabs du système
🔗 Analysis chain
Line range hint
15-15: Vérifier l'utilisation du tag "Temporary"Le GameObject utilise le tag "Temporary". Est-ce intentionnel pour ce prefab de salle d'attente ? Si ce n'est pas un état temporaire, envisagez d'utiliser un tag plus approprié.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Vérifier l'utilisation du tag "Temporary" dans le projet rg -l "Temporary" --type yamlLength of output: 178
Script:
#!/bin/bash # Search for files with "Temporary" tag in Unity prefabs and scenes find . -type f \( -name "*.prefab" -o -name "*.unity" \) -exec grep -l "Temporary" {} \; # Also search in any YAML files (Unity's meta files and settings) find . -type f -name "*.yaml" -o -name "*.yml" -exec grep -l "Temporary" {} \;Length of output: 252
Script:
#!/bin/bash # Search for other tags used in prefabs in the RoomSystem folder find ./Assets/Prefabs/RoomSystem -type f -name "*.prefab" -exec grep "m_TagString:" {} \;Length of output: 859
Assets/Scripts/Map Control/DoorSystem.cs (2)
65-65: Améliorer la clarté des messages de débogageLe message de débogage pourrait être plus descriptif pour faciliter le dépannage.
- UnityEngine.Debug.Log("No arrows found"); + UnityEngine.Debug.Log("[CorridorX7] Aucun projectile ennemi trouvé lors du nettoyage");
61-61: Suggestion d'utilisation de FindObjectsOfType pour plus de sécuritéL'utilisation de tags est sujette aux erreurs de frappe. Considérez l'utilisation de
Object.FindObjectsOfType<EnemyProjectile>()si vous avez une classe spécifique pour les projectiles ennemis.Assets/Scripts/WaitingTrapper.cs (1)
29-34: Ajoutez l'attribut [SerializeField] pour les variables privéesPour maintenir l'encapsulation tout en permettant l'édition dans l'inspecteur Unity, ajoutez l'attribut [SerializeField] aux variables privées qui nécessitent une configuration dans l'éditeur.
- private GameObject spawnOfPoint; - private GameObject door; + [SerializeField] private GameObject spawnOfPoint; + [SerializeField] private GameObject door; // Set a public sprite for the door when it's locked and unlocked - public Sprite lockedDoor; - public Sprite unlockedDoor; + [SerializeField] public Sprite lockedDoor; + [SerializeField] public Sprite unlockedDoor;Assets/Prefabs/RoomSystem/Corridor/Room.prefab (3)
Line range hint
4557-4582: Correction : Paramétrage du TilemapCollider2DLe composant
TilemapCollider2Dam_UsedByCompositedéfini sur0. Si vous utilisez des composite colliders, il serait approprié de définirm_UsedByCompositesur1pour optimiser les collisions.Appliquez ce diff pour corriger le paramètre :
m_UsedByComposite: 0 +m_UsedByComposite: 1
Line range hint
7758324542606305000-7758324542606305000: Correction : Mise à jour du tag de l'objet DoorL'objet
Doora sonm_TagStringdéfini surUntagged. Selon les conventions du projet et pour une identification cohérente, il serait préférable de le définir surDoor.Appliquez ce diff pour mettre à jour le tag :
m_Name: Door -m_TagString: Untagged +m_TagString: Door
Line range hint
4875-5837: Suggestion : Utiliser un CompositeCollider2D pour les PropsÉtant donné le grand nombre de colliders pour l'objet
Props, envisagez d'utiliser unCompositeCollider2Davec leTilemapCollider2Den mode composite. Cela simplifiera la gestion des colliders et améliorera les performances.[performance]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (7)
- Assets/Prefabs/RoomSystem/Corridor/CorridorX7.prefab (9 hunks)
- Assets/Prefabs/RoomSystem/Corridor/Room.prefab (22 hunks)
- Assets/Prefabs/RoomSystem/Doors/Door.prefab (1 hunks)
- Assets/Prefabs/RoomSystem/WaitingRoom.prefab (1 hunks)
- Assets/Scripts/Map Control/DoorSystem.cs (1 hunks)
- Assets/Scripts/WaitingTrapper.cs (3 hunks)
- ProjectSettings/TagManager.asset (1 hunks)
🔇 Additional comments (9)
ProjectSettings/TagManager.asset (1)
15-15: Ajout approprié du tag "Door"L'ajout du tag "Door" est cohérent avec la convention de nommage existante et s'intègre bien dans le système de gestion des portes.
Exécutons le script suivant pour vérifier l'utilisation du tag dans la base de code :
✅ Verification successful
Vérification réussie de l'utilisation du tag "Door"
L'analyse du code confirme que le tag "Door" est correctement utilisé dans le script WaitingTrapper.cs pour :
- Localiser l'objet porte via
GameObject.FindGameObjectWithTag("Door")- Gérer les états verrouillé/déverrouillé de la porte
- Contrôler l'apparence visuelle de la porte avec des sprites différents
L'implémentation est cohérente avec le système de gestion des portes décrit dans le résumé.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Vérifier l'utilisation du tag "Door" dans les fichiers Unity # Rechercher les références au tag "Door" dans les fichiers rg -l "tag\s*=\s*[\"']Door[\"']" || \ rg -l "CompareTag\s*\(\s*[\"']Door[\"']\s*\)" || \ rg -l "FindGameObjectsWithTag\s*\(\s*[\"']Door[\"']\s*\)" || \ rg -l "FindWithTag\s*\(\s*[\"']Door[\"']\s*\)"Length of output: 207
Script:
#!/bin/bash # Rechercher toutes les références au mot "Door" dans les fichiers C# et les prefabs rg -i "door" --type cs -C 2 # Rechercher dans les fichiers .prefab pour les références au tag Door rg -i "tag: Door" --type yamlLength of output: 4474
Assets/Prefabs/RoomSystem/WaitingRoom.prefab (2)
49-50: Les sprites de porte sont correctement référencésLes références aux sprites
lockedDooretunlockedDoorsont bien configurées avec leurs GUID respectifs.
48-48:⚠️ Potential issueAttention : Référence nulle potentielle pour playerMovement
La référence
playerMovementn'est pas assignée, ce qui pourrait provoquer une exception lors de l'exécution. Veuillez assigner cette référence dans l'inspecteur Unity.Assets/Prefabs/RoomSystem/Doors/Door.prefab (2)
106-106: Modification appropriée du tag de la porteLe changement du tag de "Untagged" à "Door" est une amélioration pertinente qui facilitera l'identification et la gestion des portes dans le système de jeu.
106-106: Vérification nécessaire du TagManagerAssurons-nous que le tag "Door" est correctement configuré dans le projet.
✅ Verification successful
Tag "Door" correctement configuré dans le TagManager
Le tag "Door" est bien défini dans le TagManager du projet, ce qui confirme son utilisation valide dans le prefab.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Vérifier que le tag "Door" est défini dans le TagManager # Test: Rechercher la définition du tag "Door" dans le TagManager rg "Door" "ProjectSettings/TagManager.asset"Length of output: 51
Assets/Prefabs/RoomSystem/Corridor/CorridorX7.prefab (3)
326-327: Assurer la cohérence des paramètres de renduLes propriétés
m_SortingLayerIDetm_SortingLayeront été modifiées. Vérifiez que ces changements sont cohérents avec le tri des calques dans tout le projet pour éviter des problèmes de rendu inattendus.Also applies to: 1282-1283
2418-2425: Confirmer les modifications des calques de tri dans le PrefabInstanceLes propriétés
m_SortingLayeretm_SortingLayerIDont été mises à jour dans lePrefabInstance. Assurez-vous que ces modifications sont nécessaires et n'affecteront pas négativement les autres instances du prefab.
646-649: 🛠️ Refactor suggestionVérifier l'utilisation de plusieurs BoxCollider2D sur le GameObject "Walls"
Plusieurs composants BoxCollider2D ont été ajoutés au GameObject "Walls". Assurez-vous que cette approche est intentionnelle. Si l'objectif est de créer des collisions complexes, il serait préférable d'utiliser un CompositeCollider2D avec des formes enfants pour améliorer les performances et faciliter la gestion des collisions.
Assets/Prefabs/RoomSystem/Corridor/Room.prefab (1)
5750-5794: Vérification : Alignement des BoxCollider2D avec les spritesAssurez-vous que les
BoxCollider2Dajoutés correspondent correctement aux sprites dans l'objetProps, notamment pour les offsets et les tailles personnalisées. Cela garantit des collisions précises et évite des comportements inattendus.
| GameObject[] arrows = GameObject.FindGameObjectsWithTag("Enemy"); | ||
|
|
||
| if (arrows.Length == 0) | ||
| { | ||
| UnityEngine.Debug.Log("No arrows found"); | ||
| } | ||
| else | ||
| { | ||
| foreach (GameObject arrow in arrows) | ||
| { | ||
| Destroy(arrow); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion
Suggestion de refactorisation pour éliminer la duplication de code
Le code de nettoyage des flèches est très similaire à celui du nettoyage des pièges. Considérez l'extraction de cette logique dans une méthode réutilisable.
Voici une suggestion d'amélioration :
+ private void CleanupGameObjects(string tag, string objectTypeName) {
+ GameObject[] objects = GameObject.FindGameObjectsWithTag(tag);
+ if (objects.Length == 0) {
+ Debug.Log($"Aucun {objectTypeName} trouvé");
+ } else {
+ foreach (GameObject obj in objects) {
+ Destroy(obj);
+ }
+ }
+ }
// Dans OnTriggerEnter2D :
- GameObject[] arrows = GameObject.FindGameObjectsWithTag("Enemy");
- if (arrows.Length == 0) {
- UnityEngine.Debug.Log("No arrows found");
- } else {
- foreach (GameObject arrow in arrows) {
- Destroy(arrow);
- }
- }
+ CleanupGameObjects("Enemy", "projectile");📝 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.
| GameObject[] arrows = GameObject.FindGameObjectsWithTag("Enemy"); | |
| if (arrows.Length == 0) | |
| { | |
| UnityEngine.Debug.Log("No arrows found"); | |
| } | |
| else | |
| { | |
| foreach (GameObject arrow in arrows) | |
| { | |
| Destroy(arrow); | |
| } | |
| } | |
| private void CleanupGameObjects(string tag, string objectTypeName) { | |
| GameObject[] objects = GameObject.FindGameObjectsWithTag(tag); | |
| if (objects.Length == 0) { | |
| Debug.Log($"Aucun {objectTypeName} trouvé"); | |
| } else { | |
| foreach (GameObject obj in objects) { | |
| Destroy(obj); | |
| } | |
| } | |
| } | |
| // Dans OnTriggerEnter2D : | |
| CleanupGameObjects("Enemy", "projectile"); |
| door = GameObject.FindGameObjectWithTag("Door"); | ||
| if (gameStart) | ||
| { | ||
| gameStart = false; | ||
| coroutineStarted = true; | ||
| StartCoroutine(StartCountdown(5)); // Start countdown for traps | ||
| } | ||
| if ( spawnOfPoint == GameObject.FindGameObjectWithTag("SpawnPoint") && !coroutineStarted){ | ||
| if (spawnOfPoint == GameObject.FindGameObjectWithTag("SpawnPoint") && !coroutineStarted) | ||
| { |
There was a problem hiding this comment.
Optimisez les appels FindGameObjectWithTag
L'utilisation de FindGameObjectWithTag dans Update est coûteuse en performances. De plus, la condition de comparaison peut être simplifiée.
- void Update()
+ void Awake()
{
spawnOfPoint = GameObject.FindGameObjectWithTag("SpawnPoint");
door = GameObject.FindGameObjectWithTag("Door");
+ }
+
+ void Update()
+ {
if (gameStart)
{
gameStart = false;
coroutineStarted = true;
StartCoroutine(StartCountdown(5));
}
- if (spawnOfPoint == GameObject.FindGameObjectWithTag("SpawnPoint") && !coroutineStarted)
+ if (spawnOfPoint != null && !coroutineStarted)
{
lockDoor();
}📝 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.
| door = GameObject.FindGameObjectWithTag("Door"); | |
| if (gameStart) | |
| { | |
| gameStart = false; | |
| coroutineStarted = true; | |
| StartCoroutine(StartCountdown(5)); // Start countdown for traps | |
| } | |
| if ( spawnOfPoint == GameObject.FindGameObjectWithTag("SpawnPoint") && !coroutineStarted){ | |
| if (spawnOfPoint == GameObject.FindGameObjectWithTag("SpawnPoint") && !coroutineStarted) | |
| { | |
| void Awake() | |
| { | |
| spawnOfPoint = GameObject.FindGameObjectWithTag("SpawnPoint"); | |
| door = GameObject.FindGameObjectWithTag("Door"); | |
| } | |
| void Update() | |
| { | |
| if (gameStart) | |
| { | |
| gameStart = false; | |
| coroutineStarted = true; | |
| StartCoroutine(StartCountdown(5)); // Start countdown for traps | |
| } | |
| if (spawnOfPoint != null && !coroutineStarted) | |
| { |
| Debug.LogError("Spawn point not found!"); | ||
| return; | ||
| } | ||
| door.GetComponent<SpriteRenderer>().sprite = lockedDoor; |
There was a problem hiding this comment.
Ajoutez une vérification de null pour door
Il manque une vérification de null pour l'objet door et son SpriteRenderer, ce qui pourrait provoquer une NullReferenceException.
private void lockDoor()
{
if (spawnOfPoint == null)
{
Debug.LogError("Spawn point not found!");
return;
}
+ if (door == null || door.GetComponent<SpriteRenderer>() == null)
+ {
+ Debug.LogError("Door or SpriteRenderer not found!");
+ return;
+ }
door.GetComponent<SpriteRenderer>().sprite = lockedDoor;
spawnOfPoint.GetComponent<BoxCollider2D>().enabled = false;
}Committable suggestion was skipped due to low confidence.
| private IEnumerator FadeToUnlockedSprite() | ||
| { | ||
| SpriteRenderer doorRenderer = door.GetComponent<SpriteRenderer>(); | ||
| float fadeDuration = 0.4f; | ||
| float elapsedTime = 0; | ||
|
|
||
| Sprite initialSprite = doorRenderer.sprite; | ||
|
|
||
| while (elapsedTime < fadeDuration) | ||
| { | ||
| elapsedTime += Time.deltaTime; | ||
| float alpha = Mathf.Lerp(1, 0, elapsedTime / fadeDuration); | ||
|
|
||
| doorRenderer.color = new Color(1, 1, 1, alpha); | ||
|
|
||
| if (alpha < 0.5f) | ||
| { | ||
| doorRenderer.sprite = unlockedDoor; | ||
| doorRenderer.color = new Color(1, 1, 1, 1 - alpha); | ||
| } | ||
|
|
||
| yield return null; | ||
| } | ||
|
|
||
| doorRenderer.sprite = unlockedDoor; |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Optimisez la gestion des composants
La coroutine pourrait être optimisée en mettant en cache le SpriteRenderer et en définissant la durée comme constante.
+ private const float FADE_DURATION = 0.4f;
+ private SpriteRenderer doorRenderer;
+
private IEnumerator FadeToUnlockedSprite()
{
- SpriteRenderer doorRenderer = door.GetComponent<SpriteRenderer>();
- float fadeDuration = 0.4f;
+ if (doorRenderer == null)
+ doorRenderer = door.GetComponent<SpriteRenderer>();
float elapsedTime = 0;
Sprite initialSprite = doorRenderer.sprite;
- while (elapsedTime < fadeDuration)
+ while (elapsedTime < FADE_DURATION)
{
elapsedTime += Time.deltaTime;
- float alpha = Mathf.Lerp(1, 0, elapsedTime / fadeDuration);
+ float alpha = Mathf.Lerp(1, 0, elapsedTime / FADE_DURATION);📝 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 IEnumerator FadeToUnlockedSprite() | |
| { | |
| SpriteRenderer doorRenderer = door.GetComponent<SpriteRenderer>(); | |
| float fadeDuration = 0.4f; | |
| float elapsedTime = 0; | |
| Sprite initialSprite = doorRenderer.sprite; | |
| while (elapsedTime < fadeDuration) | |
| { | |
| elapsedTime += Time.deltaTime; | |
| float alpha = Mathf.Lerp(1, 0, elapsedTime / fadeDuration); | |
| doorRenderer.color = new Color(1, 1, 1, alpha); | |
| if (alpha < 0.5f) | |
| { | |
| doorRenderer.sprite = unlockedDoor; | |
| doorRenderer.color = new Color(1, 1, 1, 1 - alpha); | |
| } | |
| yield return null; | |
| } | |
| doorRenderer.sprite = unlockedDoor; | |
| private const float FADE_DURATION = 0.4f; | |
| private SpriteRenderer doorRenderer; | |
| private IEnumerator FadeToUnlockedSprite() | |
| { | |
| if (doorRenderer == null) | |
| doorRenderer = door.GetComponent<SpriteRenderer>(); | |
| float elapsedTime = 0; | |
| Sprite initialSprite = doorRenderer.sprite; | |
| while (elapsedTime < FADE_DURATION) | |
| { | |
| elapsedTime += Time.deltaTime; | |
| float alpha = Mathf.Lerp(1, 0, elapsedTime / FADE_DURATION); | |
| doorRenderer.color = new Color(1, 1, 1, alpha); | |
| if (alpha < 0.5f) | |
| { | |
| doorRenderer.sprite = unlockedDoor; | |
| doorRenderer.color = new Color(1, 1, 1, 1 - alpha); | |
| } | |
| yield return null; | |
| } | |
| doorRenderer.sprite = unlockedDoor; |
| --- !u!61 &4961666462818913969 | ||
| BoxCollider2D: | ||
| m_ObjectHideFlags: 0 | ||
| m_CorrespondingSourceObject: {fileID: 0} | ||
| m_PrefabInstance: {fileID: 0} | ||
| m_PrefabAsset: {fileID: 0} | ||
| m_GameObject: {fileID: 6168419598805709018} | ||
| m_Enabled: 1 | ||
| m_Density: 1 | ||
| m_Material: {fileID: 0} | ||
| m_IncludeLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 0 | ||
| m_ExcludeLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 0 | ||
| m_LayerOverridePriority: 0 | ||
| m_ForceSendLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_ForceReceiveLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_ContactCaptureLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_CallbackLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_IsTrigger: 0 | ||
| m_UsedByEffector: 0 | ||
| m_UsedByComposite: 0 | ||
| m_Offset: {x: -2.5, y: 4.5} | ||
| m_SpriteTilingProperty: | ||
| border: {x: 0, y: 0, z: 0, w: 0} | ||
| pivot: {x: 0, y: 0} | ||
| oldSize: {x: 0, y: 0} | ||
| newSize: {x: 0, y: 0} | ||
| adaptiveTilingThreshold: 0 | ||
| drawMode: 0 | ||
| adaptiveTiling: 0 | ||
| m_AutoTiling: 0 | ||
| serializedVersion: 2 | ||
| m_Size: {x: 5, y: 14} | ||
| m_EdgeRadius: 0 | ||
| --- !u!61 &7872246779378419752 | ||
| BoxCollider2D: | ||
| m_ObjectHideFlags: 0 | ||
| m_CorrespondingSourceObject: {fileID: 0} | ||
| m_PrefabInstance: {fileID: 0} | ||
| m_PrefabAsset: {fileID: 0} | ||
| m_GameObject: {fileID: 6168419598805709018} | ||
| m_Enabled: 1 | ||
| m_Density: 1 | ||
| m_Material: {fileID: 0} | ||
| m_IncludeLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 0 | ||
| m_ExcludeLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 0 | ||
| m_LayerOverridePriority: 0 | ||
| m_ForceSendLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_ForceReceiveLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_ContactCaptureLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_CallbackLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_IsTrigger: 0 | ||
| m_UsedByEffector: 0 | ||
| m_UsedByComposite: 0 | ||
| m_Offset: {x: 9.5, y: 4.5} | ||
| m_SpriteTilingProperty: | ||
| border: {x: 0, y: 0, z: 0, w: 0} | ||
| pivot: {x: 0, y: 0} | ||
| oldSize: {x: 0, y: 0} | ||
| newSize: {x: 0, y: 0} | ||
| adaptiveTilingThreshold: 0 | ||
| drawMode: 0 | ||
| adaptiveTiling: 0 | ||
| m_AutoTiling: 0 | ||
| serializedVersion: 2 | ||
| m_Size: {x: 5, y: 14} | ||
| m_EdgeRadius: 0 | ||
| --- !u!61 &5883328970668218702 | ||
| BoxCollider2D: | ||
| m_ObjectHideFlags: 0 | ||
| m_CorrespondingSourceObject: {fileID: 0} | ||
| m_PrefabInstance: {fileID: 0} | ||
| m_PrefabAsset: {fileID: 0} | ||
| m_GameObject: {fileID: 6168419598805709018} | ||
| m_Enabled: 1 | ||
| m_Density: 1 | ||
| m_Material: {fileID: 0} | ||
| m_IncludeLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 0 | ||
| m_ExcludeLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 0 | ||
| m_LayerOverridePriority: 0 | ||
| m_ForceSendLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_ForceReceiveLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_ContactCaptureLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_CallbackLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_IsTrigger: 0 | ||
| m_UsedByEffector: 0 | ||
| m_UsedByComposite: 0 | ||
| m_Offset: {x: 3.5, y: -2} | ||
| m_SpriteTilingProperty: | ||
| border: {x: 0, y: 0, z: 0, w: 0} | ||
| pivot: {x: 0, y: 0} | ||
| oldSize: {x: 0, y: 0} | ||
| newSize: {x: 0, y: 0} | ||
| adaptiveTilingThreshold: 0 | ||
| drawMode: 0 | ||
| adaptiveTiling: 0 | ||
| m_AutoTiling: 0 | ||
| serializedVersion: 2 | ||
| m_Size: {x: 9, y: 4} | ||
| m_EdgeRadius: 0 | ||
| --- !u!61 &9041205108107242711 | ||
| BoxCollider2D: | ||
| m_ObjectHideFlags: 0 | ||
| m_CorrespondingSourceObject: {fileID: 0} | ||
| m_PrefabInstance: {fileID: 0} | ||
| m_PrefabAsset: {fileID: 0} | ||
| m_GameObject: {fileID: 6168419598805709018} | ||
| m_Enabled: 1 | ||
| m_Density: 1 | ||
| m_Material: {fileID: 0} | ||
| m_IncludeLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 0 | ||
| m_ExcludeLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 0 | ||
| m_LayerOverridePriority: 0 | ||
| m_ForceSendLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_ForceReceiveLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_ContactCaptureLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_CallbackLayers: | ||
| serializedVersion: 2 | ||
| m_Bits: 4294967295 | ||
| m_IsTrigger: 0 | ||
| m_UsedByEffector: 0 | ||
| m_UsedByComposite: 0 | ||
| m_Offset: {x: 3.5, y: 12} | ||
| m_SpriteTilingProperty: | ||
| border: {x: 0, y: 0, z: 0, w: 0} | ||
| pivot: {x: 0, y: 0} | ||
| oldSize: {x: 0, y: 0} | ||
| newSize: {x: 0, y: 0} | ||
| adaptiveTilingThreshold: 0 | ||
| drawMode: 0 | ||
| adaptiveTiling: 0 | ||
| m_AutoTiling: 0 | ||
| serializedVersion: 2 | ||
| m_Size: {x: 9, y: 4} | ||
| m_EdgeRadius: 0 |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Optimiser les colliders en utilisant un CompositeCollider2D
Au lieu d'ajouter plusieurs BoxCollider2D au même GameObject, envisagez d'utiliser un CompositeCollider2D. Cela permettra de combiner les colliders en une seule forme, améliorant ainsi les performances et la maintenabilité du code.
| - component: {fileID: 3572327062455973037} | ||
| - component: {fileID: 6854233774248888068} | ||
| - component: {fileID: 4830675212851221459} | ||
| - component: {fileID: 3572327062455973037} |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Suggestion : Vérifier la nécessité de multiples BoxCollider2D
Deux composants BoxCollider2D sont ajoutés à l'objet Walls. Assurez-vous que l'ajout de plusieurs colliders est intentionnel et nécessaire pour le comportement souhaité. Sinon, envisagez de combiner les colliders pour optimiser les performances.
| m_Offset: {x: 3, y: 12} | ||
| m_SpriteTilingProperty: | ||
| border: {x: 0, y: 0, z: 0, w: 0} | ||
| pivot: {x: 0, y: 0} | ||
| oldSize: {x: 0, y: 0} | ||
| newSize: {x: 0, y: 0} | ||
| adaptiveTilingThreshold: 0 | ||
| drawMode: 0 | ||
| adaptiveTiling: 0 | ||
| m_AutoTiling: 0 | ||
| serializedVersion: 2 | ||
| m_Size: {x: 2, y: 2} | ||
| m_EdgeRadius: 0 | ||
| --- !u!61 &408787112702833230 |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Suggestion : Combiner les BoxCollider2D pour améliorer les performances
Plusieurs composants BoxCollider2D sont ajoutés à l'objet Props. Il serait préférable de combiner ces colliders en un seul, ou d'utiliser un CompositeCollider2D si cela convient, pour optimiser les performances et faciliter la maintenance.
* Chore/shadering map (#24) * technical : add shadering and post-traitement system, adapt asset and sprite for using this * feat: update Room2 * feat: Link the chat to the back sockets (#25) * feat: Link chat to backend (#26) * feat: Link the chat to the back sockets * fix: Move the dialogue script outside the canvas to avoid it to be disabled while the canvas is going to be disabled * fix: remove dual camera * fix: fix crossbow system (#27) * fix: add request to back (room name) * fix: Revert trap manager * hotfix: Fix things that weren't working * feat: RPS (#29) * feat : add multiple option and itemscollider for RockPaperCissor * feat: Link Rock Paper Scissors to backend socket * feat: Link RockPaperScissors, but display missing --------- Co-authored-by: Thomas Lamiable <lamiablethomas@gmail.com> * hotfix: Change RPS size to match the screen * fix: fix Crossbow up sprite and arrow system, change color pixel dead font * chore: change EmptyRoom2 * feat: add death system (#30) * feat: add death system * chore: add socket emiter for end game * fix: fix heart generator if develop don't have socket * fix: remove crossbow * feature: add audio system and fix crossbow with sound (#32) Co-authored-by: Guillaume MORET <90462045+AyakorK@users.noreply.github.com> * chore: Fix env for windows (#31) * feat: add death system * chore: add socket emiter for end game * fix: fix heart generator if develop don't have socket * fix: remove crossbow * chore: try to fix .env for Windows and Unity * fix: Quick Fix in production * fix: QuickFx PlayerHealth fail merge * Fix: fix Room * feat: Adapt Waiting Room (#33) * feat: Instantiate waiting room when arriving in the corridor 0 * fix: Add a flag to change message one time and avoid repetition of it * feat: Add the creation of the room when instanciating the WaitingRoom process * feat: Try to remove the Door collider before game has started * fix: fix lock and door system, add waiting room, last fix for dialogue system for pity --------- Co-authored-by: Thomlam <lamiablethomas@gmail.com> * fix: rename bear_trap to prefab * fix: quick fix prefab room for crossbow * fix: quickfix for bear_trap * feat: Add room deletion when disconnection from a game * Wip/streaming back (#35) * feat: add streaming system with recording and sending frame jpeg * feat: add config * feat: first try to add socketIOSystem * feat: Add the right socket * feature : deploy for 60fps --------- Co-authored-by: AyakorK <guillaume.moret@yahoo.com> * hotfix: Get rid of a Debug * fix: fix arrows component and stade 24 fps to streaming * fix: Global rendering fixes (#36) * fix: Update corridor displays + additions of colliders to avoid glitching * fix: Add a door transition lock * feat: Add collision to the walls in the room * fix: Fix collisions of the hole * fix: Fix glitched hitboxes * fix: Destory arrows when going to an other room --------- Co-authored-by: Guillaume MORET <90462045+AyakorK@users.noreply.github.com> Co-authored-by: AyakorK <guillaume.moret@yahoo.com>
Summary by CodeRabbit
Nouvelles fonctionnalités
AltarSpawnPoint,FlooretWalls.Améliorations
Corrections de bugs