Pascal Serrarens 17741d862a First commit
2022-01-12 10:50:57 +01:00

35 lines
848 B
C#

using System.Collections.Generic;
using UnityEngine;
namespace Passer {
public class Script : MonoBehaviour {
public string scriptName;
public List<Condition> conditions = new List<Condition>();
public List<FunctionCall> functionCalls = new List<FunctionCall>();
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();
}
}
}
}