Default Variable Movement Field is now Optional
This commit is contained in:
parent
cda057ebeb
commit
c4edfef458
|
@ -92,6 +92,9 @@ namespace Syntriax.Modules.Movement.Config
|
||||||
foreach (string monoBehaviours in definition.MonoBehaviours)
|
foreach (string monoBehaviours in definition.MonoBehaviours)
|
||||||
MovementFactory.Instance.AddToGameObject(gameObject, monoBehaviours);
|
MovementFactory.Instance.AddToGameObject(gameObject, monoBehaviours);
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(definition.DefaultVariableMovement))
|
||||||
|
return;
|
||||||
|
|
||||||
IVariableMovementController variableMovementController = gameObject.GetComponent<IVariableMovementController>();
|
IVariableMovementController variableMovementController = gameObject.GetComponent<IVariableMovementController>();
|
||||||
VMCollection collection = VariableMovementFactory.Instance.Collections[definition.DefaultVariableMovement];
|
VMCollection collection = VariableMovementFactory.Instance.Collections[definition.DefaultVariableMovement];
|
||||||
variableMovementController?.LoadVariableMovementCollection(collection);
|
variableMovementController?.LoadVariableMovementCollection(collection);
|
||||||
|
|
Loading…
Reference in New Issue