29 lines
985 B
C#
29 lines
985 B
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Syntriax.Modules.Movement.VariableMovement.SimpleImplementation
|
|
{
|
|
public class SimpleVariableMovementController : MonoBehaviour, IVariableMovementController
|
|
{
|
|
private static IVariableMovement DefaultVariableMovement = new SimpleVariableMovement(new DefaulVariableMovementAsset());
|
|
|
|
public bool StateEnabled { get; set; } = false;
|
|
|
|
public List<IVariableMovement> VariableMovements { get; protected set; } = new List<IVariableMovement>();
|
|
public IVariableMovement CurrentVariableMovement
|
|
{
|
|
get
|
|
{
|
|
if (!StateEnabled)
|
|
return DefaultVariableMovement;
|
|
|
|
foreach (IVariableMovement variableMovement in VariableMovements)
|
|
if (variableMovement.StateEnabled)
|
|
return variableMovement;
|
|
|
|
return DefaultVariableMovement;
|
|
}
|
|
}
|
|
}
|
|
}
|