Skip to content

RevFramework — Status Effects • Timing

Default time source implementations for the Status Effects system.

This folder provides concrete runtime helpers that implement the ITimeSource contract defined in StatusEffects/Abstractions.

These are optional conveniences, not required parts of the core system.


Table of Contents


Overview

The Status Effects system advances effect timers through an injected time source.

Rather than reading Time.deltaTime directly, the StatusEffectController queries an ITimeSource, allowing effects to tick using different notions of time:

  • Scaled time (affected by Time.timeScale)
  • Unscaled time (ignores Time.timeScale)
  • Paused time (no ticking)
  • Custom time sources (turn-based, bullet-time, local clocks, etc.)

The contract lives in StatusEffects/Abstractions.
This folder contains default implementations you can use out of the box.

You are free to delete, replace, or ignore these implementations entirely.


Mental Model

Time sources answer one question only:

“How much time has passed since the last tick?”

They do not: - Drive updates - Trigger ticks - Store accumulated time - Own pause or resume logic - Decide gameplay rules

The controller pulls DeltaTime each update and applies it uniformly to all active effects.

Effects never read time directly.


Provided Time Sources

ScaledTimeSource

Uses UnityEngine.Time.deltaTime.

  • Default real-time behaviour
  • Affected by global Time.timeScale
  • Suitable for most gameplay scenarios

UnscaledTimeSource

Uses UnityEngine.Time.unscaledDeltaTime.

  • Ignores time scale
  • Useful for UI-driven effects, buffs during pause, or cinematics

PausedTimeSource

Always returns 0.

  • Effects do not tick
  • Status durations remain frozen
  • Useful for hard-paused or turn-based states

Usage

StatusEffectController selects a time source via StatusTimeMode.

controller.SetTimeMode(StatusTimeMode.Unscaled);

To use a custom source, implement ITimeSource:

public sealed class TurnBasedTimeSource : MonoBehaviour, ITimeSource
{
    public float DeltaTime => turnDelta;
}

And inject it:

controller.SetTimeMode(StatusTimeMode.Custom, myTimeSource);

Multiple controllers may use different time sources simultaneously.


Design Notes

  • Time sources are pull-based (DeltaTime), not event-driven
  • Implementations are intentionally small and stateless
  • The controller owns ticking; effects never advance themselves
  • You can swap time modes at runtime safely

This design keeps time handling explicit and testable.


Deletion Safety

You may safely remove this entire folder if:

  • You always supply your own custom ITimeSource, or
  • You do not use the default Scaled / Unscaled / Paused modes

Only the ITimeSource interface in Abstractions is required by the system.


  • Abstractions — status contracts and seams
  • Core — controller, ticking, stacking, authority