Pull request #64: - 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.
Merge in CGD/gather-and-defend from origin/bugfix/AnimationNullCheck to main * commit '25c9382dfd56e269d65e1a5af54d2a35de1beaac': - 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:
commit
9f9b518b75
@ -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>();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user