- Le jeu éteint l'animation des unités lorsque le joueur les drag-and-drop sur le terrain, réglant le problème avec l'événement dans l'animation.
This commit is contained in:
parent
fd2e2e3991
commit
25c9382dfd
@ -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<MonoBehaviour>())
|
||||
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>();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user