From 25c9382dfd56e269d65e1a5af54d2a35de1beaac Mon Sep 17 00:00:00 2001 From: MaximilienBlanchardBizien1 Date: Sun, 10 Mar 2024 19:43:30 -0400 Subject: [PATCH] =?UTF-8?q?-=20Le=20jeu=20=C3=A9teint=20l'animation=20des?= =?UTF-8?q?=20unit=C3=A9s=20lorsque=20le=20joueur=20les=20drag-and-drop=20?= =?UTF-8?q?sur=20le=20terrain,=20r=C3=A9glant=20le=20probl=C3=A8me=20avec?= =?UTF-8?q?=20l'=C3=A9v=C3=A9nement=20dans=20l'animation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scripts/Drag&Drop/GameObjectPlacementButton.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Drag&Drop/GameObjectPlacementButton.cs b/Assets/Scripts/Drag&Drop/GameObjectPlacementButton.cs index 375f28f..ac68c4e 100644 --- a/Assets/Scripts/Drag&Drop/GameObjectPlacementButton.cs +++ b/Assets/Scripts/Drag&Drop/GameObjectPlacementButton.cs @@ -1,4 +1,6 @@ -using System.Linq; +using System.ComponentModel; +using System.Linq; +using UnityEditor; using UnityEngine; public class GameObjectPlacementButton : UnitPlacementButton @@ -32,6 +34,16 @@ public class GameObjectPlacementButton : UnitPlacementButton Destroy(coll); foreach (var script in instance.transform.GetAllComponents()) Destroy(script); + if(instance.GetComponentsInChildren().Length > 0) instance.GetComponentInChildren().enabled = false; + + //foreach(var animator in instance.GetComponentInChildren().runtimeAnimatorController.animationClips) + //{ + // //animator + // foreach(var animEvent in animator.events) + // { + // //animEvent = null; + // } + //} var placeholder = instance.AddComponent();