using System.Collections.Generic; namespace Assets._Project.Develop.Runtime.Utilities.StateMachineCore { public abstract class ParallelState : State where TState : class, IState { private List _states; public ParallelState(params TState[] states) { _states = new List(states); } protected IReadOnlyList States => _states; public override void Enter() { base.Enter(); foreach (TState state in _states) state.Enter(); } public override void Exit() { base.Exit(); foreach (TState state in _states) state.Exit(); } } }