// Update is called once per frame void FixedUpdate() { if (Active) { CurrentTime += Time.deltaTime; CurrentTimeUpdated?.Invoke(this, CurrentTime); if (CurrentTime >= timeInterval) { if (!SingleUse) { OnTick?.Invoke(this, CurrentTime); CurrentTime = 0f; } else { OnTick?.Invoke(this, CurrentTime); Active = false; } } } }
/// <summary> /// /// </summary> public virtual void Update() { CurrentTimeUpdated?.Invoke(this, EventArgs.Empty); }