Merge remote-tracking branch 'origin/main' into feature/InvestigationSpawnConstant

This commit is contained in:
Ader Alisma 01 2024-03-17 12:10:04 -04:00
commit 8e8c32ca68

View File

@ -1,4 +1,6 @@
using System.Linq; using System.ComponentModel;
using System.Linq;
using UnityEditor;
using UnityEngine; using UnityEngine;
public class GameObjectPlacementButton : UnitPlacementButton public class GameObjectPlacementButton : UnitPlacementButton
@ -32,6 +34,16 @@ public class GameObjectPlacementButton : UnitPlacementButton
Destroy(coll); Destroy(coll);
foreach (var script in instance.transform.GetAllComponents<MonoBehaviour>()) foreach (var script in instance.transform.GetAllComponents<MonoBehaviour>())
Destroy(script); Destroy(script);
if(instance.GetComponentsInChildren<Animator>().Length > 0) instance.GetComponentInChildren<Animator>().enabled = false;
//foreach(var animator in instance.GetComponentInChildren<Animator>().runtimeAnimatorController.animationClips)
//{
// //animator
// foreach(var animEvent in animator.events)
// {
// //animEvent = null;
// }
//}
var placeholder = instance.AddComponent<ObjectPlaceholder>(); var placeholder = instance.AddComponent<ObjectPlaceholder>();