Added Movements List to the IMovementController + Code Improvement

This commit is contained in:
2022-03-10 23:18:11 +03:00
parent e531bdf77e
commit a991c05fad
4 changed files with 65 additions and 34 deletions

View File

@@ -24,6 +24,7 @@ namespace Syntriax.Modules.Movement.VariableMovement
}
}
protected bool isSet = false;
protected IMovementController movementController = null;
protected IVariableMovement defaultVariableMovement = null;
protected List<IVariableMovementWithState> variableMovementsWithState = null;
@@ -43,7 +44,13 @@ namespace Syntriax.Modules.Movement.VariableMovement
}
protected void SetMultiplierToActiveMovement(IMovement currentMovement)
=> currentMovement.MovementMultiplier = ActiveVariableMovement.Asset.Multiplier;
{
if (!isSet)
return;
currentMovement.MovementMultiplier = ActiveVariableMovement.Asset.Multiplier;
}
public void LoadVariableMovementCollection(VMCollection collection)
{
@@ -51,6 +58,7 @@ namespace Syntriax.Modules.Movement.VariableMovement
throw new System.NullReferenceException("InputActionCollection must be set on the VariableMovementController to load a collection!");
this.collection = collection;
isSet = true;
UnsubscribeFromMovements();