unity-atoms/Packages/Core/Runtime/Variables/VariableResetter.cs

20 lines
518 B
C#
Raw Normal View History

2020-03-15 18:18:29 -04:00
using System.Collections.Generic;
using UnityEngine;
namespace UnityAtoms
{
[AddComponentMenu("Unity Atoms/Variable Resetter")]
[DefaultExecutionOrder(Runtime.ExecutionOrder.VARIABLE_RESETTER)]
public class VariableResetter : MonoBehaviour
{
public List<AtomBaseVariable> _variables = new List<AtomBaseVariable>();
void OnEnable()
{
for (var i = 0; i < _variables.Count; ++i)
{
2020-03-15 19:18:26 -04:00
_variables[i].Reset(true);
2020-03-15 18:18:29 -04:00
}
}
}
}