Movement/VariableMovement/VariableMovementBehaviourAp...

25 lines
789 B
C#
Raw Normal View History

2022-03-05 13:47:41 +03:00
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Syntriax.Modules.Movement.VariableMovement
{
public class VariableMovementBehaviourApplier : MonoBehaviour
{
private List<IMovement> movements = new List<IMovement>();
private IVariableMovementController variableMovementController = null;
private void Start()
{
movements = GetComponents<IMovement>().ToList();
variableMovementController = GetComponent<IVariableMovementController>();
}
private void Update()
{
foreach (var movement in movements)
movement.MovementMultiplier = variableMovementController.CurrentVariableMovement.VariableMovementAsset.MovementMultiplier;
}
}
}