/* * Disallow anything to be done until initialized. */ public void Init(StartOfAction _startFn, EndOfAction _endFn, float newTime, float newCooldown, float delay) { ready = true; SetFunctions(_startFn, _endFn); SetTimes(newTime, newCooldown); SetDelay(delay); }
// Baseline initializtion. private void Awake() { ready = false; inAction = false; startFn = null; endFn = null; currentTime = currentCooldown = delay = maxTime = maxCooldown = 0f; }
public void SetFunctions(StartOfAction _startFn, EndOfAction _endFn) { if (!ready) { Debug.LogWarning("Changing functions for " + this + " when Timer is not ready, or unitialized"); return; } startFn = _startFn; endFn = _endFn; }