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();