25 lines
513 B
C#
25 lines
513 B
C#
using System.Collections.Generic;
|
|
using XRLib;
|
|
|
|
namespace XED.ComponentSystem
|
|
{
|
|
public class ActionComponentRunner : MonoBehaviour, ISingle
|
|
{
|
|
public List<ActionComponent> components =new();
|
|
public void Add(ActionComponent ac)
|
|
{
|
|
components.Add(ac);
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
foreach (var c in components)
|
|
{
|
|
if (!c.isStarted)
|
|
c.Start();
|
|
|
|
c.Run();
|
|
}
|
|
}
|
|
}
|
|
} |