From cda057ebebedc168f7a36a1498350cdfcae8a1eb Mon Sep 17 00:00:00 2001 From: Syntriax Date: Sun, 27 Mar 2022 20:57:17 +0300 Subject: [PATCH] Fix --- Config/MovementDefinitionFactory.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Config/MovementDefinitionFactory.cs b/Config/MovementDefinitionFactory.cs index ef56fd5..fc28f52 100644 --- a/Config/MovementDefinitionFactory.cs +++ b/Config/MovementDefinitionFactory.cs @@ -88,8 +88,9 @@ namespace Syntriax.Modules.Movement.Config movement.BaseSpeed = movementConfig.BaseSpeed; } - foreach (string monoBehaviours in definition.MonoBehaviours) - MovementFactory.Instance.AddToGameObject(gameObject, monoBehaviours); + if (definition.MonoBehaviours != null) + foreach (string monoBehaviours in definition.MonoBehaviours) + MovementFactory.Instance.AddToGameObject(gameObject, monoBehaviours); IVariableMovementController variableMovementController = gameObject.GetComponent(); VMCollection collection = VariableMovementFactory.Instance.Collections[definition.DefaultVariableMovement]; @@ -100,7 +101,7 @@ namespace Syntriax.Modules.Movement.Config public void SaveMovementDefinition(MovementDefinition definition) { string jsonText = JsonUtility.ToJson(definition, true); - string path = $"Assets/Resources/{ ResourceDirectoryToDefinitions }{definition.Name}.json"; + string path = $"Assets/Resources/{ ResourceDirectoryToDefinitions }{ definition.Name }.json"; System.IO.File.WriteAllText(path, jsonText); } #endif