using System.Collections.Generic; using UnityEngine; namespace Passer { public class Script : MonoBehaviour { public string scriptName; public List conditions = new List(); public List functionCalls = new List(); protected virtual void Reset() { this.enabled = false; } protected virtual void OnEnable() { Execute(); } protected virtual void Start() { Execute(); } public void Execute() { foreach (Condition condition in conditions) { if (!condition.Check()) return; } foreach (FunctionCall functionCall in functionCalls) { functionCall.Execute(); } } } }