Default Variable Movement Field is now Optional

This commit is contained in:
Syntriax 2022-04-03 19:56:25 +03:00
parent cda057ebeb
commit c4edfef458
1 changed files with 6 additions and 3 deletions

View File

@ -92,6 +92,9 @@ namespace Syntriax.Modules.Movement.Config
foreach (string monoBehaviours in definition.MonoBehaviours)
MovementFactory.Instance.AddToGameObject(gameObject, monoBehaviours);
if (string.IsNullOrEmpty(definition.DefaultVariableMovement))
return;
IVariableMovementController variableMovementController = gameObject.GetComponent<IVariableMovementController>();
VMCollection collection = VariableMovementFactory.Instance.Collections[definition.DefaultVariableMovement];
variableMovementController?.LoadVariableMovementCollection(collection);