⌚
Timeflow
  • ⌚Introduction
  • 📗User Guide
    • â–ļī¸Getting Started
      • ✅Requirements
      • âŦ‡ī¸Installation
      • 🚀Quick Start
      • âœī¸Workflow
      • đŸŽŦRender Pipeline
      • â¯ī¸Editor vs Runtime
      • đŸĻŋHow it Works
      • â›‘ī¸Potential Issues
      • ⚡Optimization
      • 🔨3rd Party Tools
      • đŸ”ĸUpgrading Guide
    • â„šī¸Timeflow Editor
      • đŸŽ›ī¸Menu Bar
      • â˛ī¸Time
      • Local Time Scope
      • 🧰Work Area
      • âš™ī¸Settings
      • âŗUpdate Settings
      • đŸ“ēDisplay Lists
      • đŸ”ģMarkers
      • đŸ”ĩObject
      • 🏭Managed Objects
      • ⚡Quick Select Objects
      • âš’ī¸Tools
    • đŸŽŦTimeflow View
      • 🔩Toolbar
        • 🔑Auto Keyframing
        • â¯ī¸Play Controls
        • đŸĨ…Work Area
        • â¯ī¸Current Time
        • đŸŽŧMusical Timing
        • 🌐Grid and Snap
        • 🔸Keyframe Values
        • đŸ”ģMarkers
      • â˛ī¸Timeline
      • 📐Time Navigation
      • Local Time Scope
      • 🎏Track View
      • â†˜ī¸Selection
      • 📰Object Panel
      • đŸ“ēDisplay Lists
      • 🍱Channels
      • đŸŖProperties
      • 🔗Channel Link
      • đŸšĨSwitches
      • 📅Values Column
      • đŸ›¤ī¸Tracks
      • 🔸Keyframes
      • đŸ“ļAlignment Tools
      • ⌛Time Offset
      • đŸ”ĸInfo Panel
      • 📉Graph View
      • âœ‚ī¸Keyframe Tools
    • 🍰Menus & Shortcuts
      • 📃Context Menus
        • â†–ī¸Select Menu
        • 📰Object Menu
        • 🍱Channel Menu
        • đŸ›¤ī¸Tracks Menu
        • 🔸Keyframes Menu
        • đŸ”ģMarkers Menu
        • 📰View Menu
        • 📰Events Menu
        • đŸĨ…Work Area Menu
      • đŸ—ƒī¸File Menu
      • âš’ī¸Timeflow Menu
        • đŸ•ēAdd Behavior
        • đŸ”ļAnimation
        • 🍱Composition
        • đŸ“ēDisplay
        • ⏊Jump To
        • 👨‍đŸ‘Ļ‍đŸ‘ĻHierarchy
        • 🌐Mesh
        • 👉Select
        • 📚Tracks
        • 🌈Track Colors
        • â†”ī¸Transform
        • đŸ‘ī¸Visibility
        • đŸ› ī¸Editor
      • đŸ”ĩGame Objects Menu
      • đŸŽ›ī¸Presets
      • âš™ī¸Preferences
        • Assets
        • ⌛Time
        • đŸŗī¸â€đŸŒˆTracks
        • âšĒObjects
        • 🧮Channels
        • đŸ”ļKeyframes
        • 🔠Input
        • đŸ“ĨImport
        • đŸ–ŧī¸Rendering
        • đŸŽ›ī¸Overrides
        • 🍱Extras
      • *ī¸âƒŖKeyboard Shortcuts
        • Managing Shortcuts
      • âœ´ī¸Quick Menu
  • Reference
    • đŸ”ĩTimeflow Object
      • đŸĸTracks
      • 🏭Behaviors
      • ⏰Events
      • đŸ—ƒī¸Channels
    • 💃Timeflow Controller
      • đŸŽžī¸Timeflow Playback
    • đŸĒ„Behaviors
      • đŸŽžī¸Animation
        • 🔸Keyframer
        • â†”ī¸Tween
        • 🔀Blend
        • đŸŽĸMotion Path
        • đŸ‘¯Animation Clips
        • 🌴Animator Blend Trees
        • 😁Blend Shapes
      • 🤖Automation
        • 🛸Auto Bank
        • 🧭Auto Rotate
        • 📐Distance
        • ⏰Event
        • đŸ›Šī¸Flyby
        • 🏃Follow
        • 👀Look At
        • đŸŽ¯Look At Target
        • 🎲Noise
        • 🚊Place On Path
        • đŸī¸Place On Surface
      • 🔊Audio
        • 🔊Audio Track
        • đŸŽŧAudio Spectrum
        • đŸŽĩAudio Sample
        • đŸŽ™ī¸Audio Reactive
      • 🎹MIDI
        • 🎹Midi File
        • đŸĨMidi Tween
        • 📡Midi Receiver
          • đŸŽ›ī¸Minis Setup (New Input System)
          • đŸšĨMidiJack Setup (Legacy Input)
      • 🏁Rendering
        • đŸŽžī¸Render To Disk
        • 📋Render Queue
        • đŸ“Ŋī¸Video Encoding
        • 💡Tips & Optimizations
        • âēī¸Unity Recorder
      • 🔧Tools
        • â„šī¸Animator Info
        • 🧮Align Children
        • đŸ’ŦComment
        • #ī¸âƒŖFPS Counter
        • 📈Graph
        • 🔗Property Link
        • 🔄Rotator
        • ✨Particle System Update
        • 🌈Trail Renderer Update
        • đŸ“ēVideo Player Update
    • đŸ—ƒī¸Precomposing
    • 🏭Prefabs
    • đŸŽ›ī¸Editor Overrides
      • 🏹Transform Editor Override
    • 🔌Integrations
      • đŸ§™â€â™‚ī¸Adventure Creator
      • đŸŽ›ī¸MIDI Jack | Minis
      • đŸ¤ēSpine Animation
      • đŸ“Ŋī¸Unity Timeline
      • ➰Unity Splines
    • đŸĒSamples
      • đŸ•šī¸Demo App
      • đŸŽžī¸Cutscenes
      • 🏓Physics
      • 🍧Shader Properties
      • ⚡Visual Effect Graph (VFX)
    • 📖Glossary
    • 📗Scripting
    • đŸ“ŖPublished Works
    • âš ī¸Known Issues
    • 🆘Support
    • đŸ§ĒBeta
    • Roadmap
    • đŸ”ĸVersion History
    • ÂŠī¸Terms & Privacy
Powered by GitBook
On this page
  • Timeflow
  • Work Area Enabled
  • Play Mode
  • Skip Duration
  • Start At Marker Index
  • Start Play Mode
  • Play Modes
  • None
  • One Shot
  • Looped
  • Continuous
  • Unity Events
  • On Startup
  • On Play
  • On Stop
  • On Skip
  • Methods
  • SetWorkAreaStart(float startTime)
  • SetWorkAreaEnd(float endTime)
  • SetWorkArea(float startTime, float endTime)
  • PlayFromMarkerIndex(int index)
  • PlayFromMarker(string markerName)
  • PlayFromMarker(TimeflowMarker marker)
  • PlayFromTime(float time)
  • PlayFromStart()
  • Play()
  • Skip()
  • Stop()
  • SetPlayModeOneShot()
  • SetPlayModeContinuous()
  • SetPlayModeLooped()
  1. Reference

Timeflow Controller

A script to control Timeflow playback at runtime

PreviousChannelsNextTimeflow Playback

Last updated 6 months ago

This component may be used to start and stop playback, queue specific markers, or play custom regions in time. Use the Timeflow Controller for cutscenes or to play animations interactively.

To add a new Timeflow Controller, first select the Timeflow instance in the scene that you wish to control, and then select from the main menu:

Tools/Timeflow/Add/Timeflow Controller

The Timeflow Controller is a relatively simple script to provide a general API for working with Timeflow, however it is not comprehensive and much more is possible with custom scripts if needed. This controller is meant to provide basic functionality. If you are a developer with specific needs, you may choose to extend this script or create your own.

Timeflow

Designates the Timeflow instance being controlled. Any other Timeflow instances in the scene will not be affected by this controller, unless they are children of the target Timeflow.

Work Area Enabled

Play Mode

This sets the default play mode when the Play() method is called.

The play mode can also be set dynamically by script or event by calling one of the SetPlayMode methods.

Skip Duration

This specifies the duration in seconds to lead out of the current work area region when Skip() is invoked. If for example the current work area ends at 10 seconds and the skip duration is set to 2, invoking Skip() will fast forward to 8 seconds and play through to the end at 10.

Use the Skip Duration to provide a smooth outro transition. Otherwise, if the value is set to 0, playback will stop abruptly (cut) when Skip() is invoked. Note also that you can set the Skip Duration by script or event if needed.

Start At Marker Index

Queues Timeflow to play on scene start at the designated marker by index value. Each marker in Timeflow has a unique index (integer value). Typically, 1 is the first index in the scene unless it has been changed.

Start Play Mode

Sets the play mode initially upon scene start.

Play Modes

Determines how playback behaves, with one of the following settings.

None

Timeflow does not play and remains paused. Use this mode to stop Timeflow completely.

One Shot

Plays through the designated time region once. When it reaches the end of the current area, playback stops.

One Shot mode is typically used for cutscenes to play a specific section of the timeline just once and then stop.

Looped

Plays the current work area (or full timeline) repeating indefinitely.

Use Looped mode to create living holds or sections of time that play repeatedly until interrupted by the user or some other event.

Continuous

This mode continues to play even when the end of the work area is reached. However, playback will stop when it reaches the end of the timeline.

Unity Events

Unity Events are also helpful for decoupling logical components in a game. For programmers, one helpful tip is that you may use ScriptableObjects to receive and pass events and data between scenes without directly referencing game objects in the scene.

On Startup

This event is called once when the Timeflow Controller initially starts. This event is invoked during Start(), after the above startup play mode has been executed.

On Play

This event is invoked each time any Play method is called on the Timeflow Controller.

Use On Play to setup additional logic when playing a section of time. For example, this can be used when playing cutscenes to disable player input and display UI elements.

On Stop

This event is invoked once playback stops or reaches the end of the current time section.

Use this event to return control back to the player after a cutscene and to hide any other elements displayed during playback.

On Skip

This event is invoke when Skip() is called, either by script or by an event.

Use this event to perform additional logic when playback is skipped by the user or interrupted by another event.

Methods

The following methods are defined in the Timeflow Controller script and may be called wither by script or events.

SetWorkAreaStart(float startTime)

Explicitly set the start time of the playback region.

SetWorkAreaEnd(float endTime)

Sets the end time of the current playback region.

SetWorkArea(float startTime, float endTime)

Sets the start and end time of the current playback region in one call.

PlayFromMarkerIndex(int index)

Queue playback starting from the marker with the given index, automatically setting the time region up to the following marker.

PlayFromMarker(string markerName)

Queues playback of a marker region with a specific name, automatically setting the time range up to the next marker after it.

Using marker names is preferred in most cases since it is easier to read.

Be careful to enter marker names precisely. They are case sensitive. If no marker is found matching the specified name, nothing will happen.

PlayFromMarker(TimeflowMarker marker)

Queues playback using a marker reference. This is called internally or by other scripts with a TimeflowMarker object.

PlayFromTime(float time)

Starts playback from a specific time in seconds.

PlayFromStart()

Starts playback from the beginning of the current work area, or the start of the timeline if the work area is off.

Play()

Resumes playing from the current time.

Skip()

Advances time to the end of the current work area. If the Skip Duration is set, the time is advanced to that duration before the end, to allow lead out time.

Stop()

Stops playback. This is also the same as pausing Timeflow. If Play() is called afterward, it resumes from the current tiem.

SetPlayModeOneShot()

The SetPlayMode...() methods can be set by script or an event to prepare a cutscene or other section of time for playback. It's best to call this before Play().

SetPlayModeContinuous()

SetPlayModeLooped()

This determines whether the is used in Timeflow to constrain playback to a specific region in time. In most cases, the Work Area is desired to set the start and end time for the current marker being played, though it may be turned off to continue to play the timeline until the end, or until interrupted by another event.

Note that index values may change if the command is used in the Timeflow Markers inspector.

The following events can be configured in the editor to perform additional actions. These can be used to setup game logic in the editor without additional scripting. For more information, see the .

Sets the current play mode to .

Sets the current play mode to .

Sets the current play mdoe to .

💃
Work Area
Unity Events documentation
One Shot
Continuous
Looped
Re-Index