Skip to main content

TimeUpdater

Manages the state and time changes for an AnimationPlayer

Types

AnimationState

enum
interface AnimationState {
Playing0
Paused1
Stopped2
PlayingEasing3
PausingEasing4
}

ReachedAnimationLengthType

enum
interface ReachedAnimationLengthType {
None0
Reached1
Looped2
Stopped3
}

TimeUpdaterTweenData

interface TimeUpdaterTweenData {
lengthnumber--

Amount of time that will be tweened.

durationnumber--

Total time this tween will last for

startDurationnumber?--

Time this tween will start at. Default is 0.

endDurationnumber?--

Time this tween will stop at. Usually duration.

styleEnum.EasingStyle
directionEnum.EasingDirection
}

Range will be from [start, start + length] Duration will be from [startDuration or 0, duration or endDuration]

AnimationStateData

interface AnimationStateData {
tweenDataTimeUpdaterTweenData | nil
}

TimeUpdateState

interface TimeUpdateState {
currentTimenumber--

Current time

previousTimenumber--

Last updated time

currentModelTimenumber--

Current time used for visual (models)

currentStartTimenumber
currentTimeKeeperTimenumber
lastTimeKeeperTimenumber
animationLengthnumber
hasPassedLengthboolean
wasCurrentTimeSetboolean
wasCurrentStartTimeSetboolean
currentUpdateDirectionboolean
}

State generated during an active or playing state. Basically the minimum time update data used for triggers. This state is cached and can be used via bound updaters to get their state.

TimeUpdateData

interface TimeUpdateData {
currentTimenumber--

Current time

previousTimenumber--

Last updated time

currentModelTimenumber--

Current time used for visual (models)

currentStartTimenumber
currentTimeKeeperTimenumber
lastTimeKeeperTimenumber
animationLengthnumber
hasPassedLengthboolean
wasCurrentTimeSetboolean
wasCurrentStartTimeSetboolean
currentUpdateDirectionboolean
currentStateAnimationStateData
hasStateChangedboolean--

If true, currentState is different from lastState in this update.

isLoopedboolean
hasIsLoopedChangedboolean
timeScalenumber
hasTimeScaleChangedboolean
updateDirectionboolean
hasUpdateDirectionChangedboolean
lastReachedAnimationLengthTypeReachedAnimationLengthType
}

Data generated during an update. Extends TimeUpdateState

Properties

timeKeeper

TimeUpdater.timeKeeper: TimeKeeper

An object that helps with managing time updating

currentTime

TimeUpdater.currentTime: number

The current time in seconds

currentModelTime

TimeUpdater.currentModelTime: number

The current time used visually in seconds

wasCurrentTimeSet

TimeUpdater.wasCurrentTimeSet: boolean

If true, setCurrentTime was called between the last update

currentState

TimeUpdater.currentState: AnimationStateData

The current state of the TimeUpdater

lastState

TimeUpdater.lastState: AnimationStateData

The last updated state of the TimeUpdater

currentStartTime

TimeUpdater.currentStartTime: number

An internal start time used for time keeping

isLooped

TimeUpdater.isLooped: boolean

Determines whether time should restart at 0 when time reaches animationLength. Otherwise sets state to Stopped and currentTime to the animationLength.

timeScale

TimeUpdater.timeScale: number

A value used to scale how fast time moves

lastTimeScale

TimeUpdater.lastTimeScale: number

updateDirection

TimeUpdater.updateDirection: boolean

Determines which direction time moves, forwards (true) or backwards (false).

lastUpdateDirection

TimeUpdater.lastUpdateDirection: boolean

lastTimeUpdateState

TimeUpdater.lastTimeUpdateState: TimeUpdateState

lastReachedAnimationLengthType

TimeUpdater.lastReachedAnimationLengthType: ReachedAnimationLengthType

currentTimeReducerOption

TimeUpdater.currentTimeReducerOption: Option<(currentTimenumber)=>number>

An option for a reducer used to modify the currentTime every update See :setCurrentTimeReducer()

boundUpdaterData

TimeUpdater.boundUpdaterData: {
timeUpdaterTimeUpdater
} | nil

Data for the current bound updater

canChangeStateOnPlayingFromStopped

setting
TimeUpdater.canChangeStateOnPlayingFromStopped: boolean

Prevents state from changing from Playing to Stopped. Useful if state is controlled by another object (i.e. the server)

canChangeStateOnAnimationLengthReached

setting
TimeUpdater.canChangeStateOnAnimationLengthReached: boolean

Prevents looping or stopping TimeUpdater when it reaches the current animation's length. Useful if state is controlled by another object (i.e. the server)

canChangeStateOnEasingStateFinished

setting
TimeUpdater.canChangeStateOnEasingStateFinished: boolean

Prevents state from changing when it finishes an easing state. Useful if state is controlled by another object (i.e. the server)

canResetTimeKeeper

setting
TimeUpdater.canResetTimeKeeper: boolean

Prevents TimeKeeper from resetting on state or time changes. Useful if state is controlled by another object (i.e. the server)

Functions

new

Constructor
TimeUpdater.new(timeKeeperTimeKeeper) → TimeUpdater

Constructor

isInactiveState

TimeUpdater.isInactiveState(stateAnimationState | AnimationStateData) → boolean

Returns true if the state will NOT update time

isActiveState

TimeUpdater.isActiveState(stateAnimationState | AnimationStateData) → boolean

Returns true if the state will update time

isPlayingState

TimeUpdater.isPlayingState(stateAnimationState | AnimationStateData) → boolean

Returns true if the state is Playing

isEasingState

TimeUpdater.isEasingState(stateAnimationState) → boolean

Returns true if the state uses easing

getEasingAlpha

TimeUpdater.getEasingAlpha(
timePassednumber
) → number,number

Get the easing time for the current state

getEasingTime

TimeUpdater.getEasingTime(
startTimenumber,
timePassednumber,
animationLengthnumber,
isLoopedboolean
) → EasingUpdateData

Types

interface EasingUpdateData {
currentTimenumber
currentModelTimenumber
timeDeltanumber
hasFinishedboolean
finishedDifferencenumber
}

Get the easing time for the current state

Destroy

Deconstructor
TimeUpdater:Destroy() → ()

Deconstructor

update

TimeUpdater:update(
steppednumber,
animationLengthnumber
) → TimeUpdateData

Updates the TimeUpdater

_updateLinearTimeState

TimeUpdater:_updateLinearTimeState(
steppednumber,
animationLengthnumber,
lastUpdateTimenumber,
currentStateAnimationStateData,
lastStateAnimationStateData,
hasStateChangedboolean,
wasCurrentTimeSetboolean,
hasTimeScaleChangedboolean,
hasUpdateDirectionChangedboolean
) → ()

Updates Linear TimeState (Playing)

_updateEasingTimeState

TimeUpdater:_updateEasingTimeState(
steppednumber,
animationLengthnumber,
lastUpdateTimenumber,
currentStateAnimationStateData,
lastStateAnimationStateData,
hasStateChangedboolean,
wasCurrentTimeSetboolean,
hasTimeScaleChangedboolean,
hasUpdateDirectionChangedboolean
) → ()

Updates Easing TimeStates (PlayingEasing, PausingEasing, StoppingEasing)

_updateBoundUpdaterTimeState

TimeUpdater:_updateBoundUpdaterTimeState(
boundUpdaterTimeUpdater,
animationLengthnumber,
lastUpdateTimeany
) → TimeUpdateState

Updates bound animation player

setCurrentTimeReducer

TimeUpdater:setCurrentTimeReducer(reducer((currentTimenumber) → number)?) → ()

Sets a function which processes the new current time after it has been updated by the TimeUpdater and returns a new time. Used to set offset the current time.

setCurrentTime

TimeUpdater:setCurrentTime(
newCurrentTimenumber,
keepStateboolean?
) → ()

Sets the currentTime of the TimeUpdater If currentState is Stopped and keepState is not true, will change the current state to Paused. This is so when state changes to Playing, it will resume from the new time instead of starting from 0.

getLastTimeUpdateState

TimeUpdater:getLastTimeUpdateState() → TimeUpdateState

Returns the last updated TimeUpdateState

getCurrentData

TimeUpdater:getCurrentData() → TimeUpdateData

Returns a snapshot of the current TimeUpdateData with all flags set to false

getCurrentState

TimeUpdater:getCurrentState() → AnimationState

Returns the current state

getCurrentTime

TimeUpdater:getCurrentTime() → number

Returns the currentTime

isLooping

TimeUpdater:isLooping() → boolean

Returns .isLooped

getIsLooped

TimeUpdater:getIsLooped() → boolean

Returns .isLooped

getTimeScale

TimeUpdater:getTimeScale() → number

Returns .timeScale

getUpdateDirection

TimeUpdater:getUpdateDirection() → boolean

Returns .updateDirection

isActive

TimeUpdater:isActive() → boolean

Returns true if currentState will update time

isInactive

TimeUpdater:isInactive() → boolean

Returns true if currentState will NOT update time

isPlaying

TimeUpdater:isPlaying() → boolean

Returns true if currentState is AnimationState.Playing

isPaused

TimeUpdater:isPaused() → boolean

Returns true if currentState is AnimationState.Paused

isStopped

TimeUpdater:isStopped() → boolean

Returns true if currentState is AnimationState.Stopped

isEasing

TimeUpdater:isEasing() → boolean

Returns true if currentState uses easing.

setIsLooped

TimeUpdater:setIsLooped(valueboolean) → ()

Sets whether it will return to start when animation length is reached

setTimeScale

TimeUpdater:setTimeScale(valueboolean) → ()

Sets how fast time will move

setUpdateDirection

TimeUpdater:setUpdateDirection(valueboolean) → ()

Sets which direction time moves: forwards (true) or backwards (false).

restart

TimeUpdater:restart() → ()

Restarts the TimeUpdater. Sets currentTime to 0 and currentState to Playing.

play

TimeUpdater:play() → ()

Sets the current state to Playing

pause

TimeUpdater:pause() → ()

Sets the current state to Paused

stop

TimeUpdater:stop() → ()

Sets the current state to Stopped

playWithEasing

TimeUpdater:playWithEasing(tweenDataTimeUpdaterTweenData) → ()

Tweens using the given state, then transitions to a Playing state Sets the current state to PlayingEasing

pauseWithEasing

TimeUpdater:pauseWithEasing(tweenDataTimeUpdaterTweenData) → ()

Tweens using the given state, then transitions to a Paused state Sets the current state to PausingEasing

stopWithEasing

TimeUpdater:stopWithEasing(tweenDataTimeUpdaterTweenData) → ()

Tweens using the given state, then transitions to a Stopped state Sets the current state to StoppingEasing

setState

TimeUpdater:setState(
newStateAnimationState,
) → ()

Sets the current AnimationState

bindToUpdater

TimeUpdater:bindToUpdater(
timeUpdaterTimeUpdater,
bindToUpdaterTypeBindToUpdaterType
) → ()

Types

interface BindToUpdaterType {
State0
Time1
StateAndTime2
}

Binds this time updater to the given time updater so that states transfer over binding to a time updater should give that time updater control over this one's states it should not change time on playing from stop (tho this might be overwritten by the time reducer) when animation length is reached

unbindFromUpdater

TimeUpdater:unbindFromUpdater() → ()

Unbinds the currently bound TimeUpdater

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructor",
            "params": [
                {
                    "name": "timeKeeper",
                    "desc": "",
                    "lua_type": "TimeKeeper"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TimeUpdater"
                }
            ],
            "function_type": "static",
            "tags": [
                "Constructor"
            ],
            "source": {
                "line": 298,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Deconstructor",
            "params": [],
            "returns": [],
            "function_type": "method",
            "tags": [
                "Deconstructor"
            ],
            "source": {
                "line": 371,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isInactiveState",
            "desc": "Returns true if the state will NOT update time",
            "params": [
                {
                    "name": "state",
                    "desc": "",
                    "lua_type": "AnimationState | AnimationStateData"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 381,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isActiveState",
            "desc": "Returns true if the state will update time",
            "params": [
                {
                    "name": "state",
                    "desc": "",
                    "lua_type": "AnimationState | AnimationStateData"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 392,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isPlayingState",
            "desc": "Returns true if the state is Playing",
            "params": [
                {
                    "name": "state",
                    "desc": "",
                    "lua_type": "AnimationState | AnimationStateData"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 406,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isEasingState",
            "desc": "Returns true if the state uses easing",
            "params": [
                {
                    "name": "state",
                    "desc": "",
                    "lua_type": "AnimationState"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 417,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "getEasingAlpha",
            "desc": "Get the easing time for the current state",
            "params": [
                {
                    "name": "tweenData",
                    "desc": "",
                    "lua_type": "TimeUpdaterTweenData"
                },
                {
                    "name": "timePassed",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number, number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 446,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "getEasingTime",
            "desc": "Get the easing time for the current state",
            "params": [
                {
                    "name": "startTime",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "timePassed",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "tweenData",
                    "desc": "",
                    "lua_type": "TimeUpdaterTweenData"
                },
                {
                    "name": "animationLength",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "isLooped",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "EasingUpdateData"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 465,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "update",
            "desc": "Updates the TimeUpdater",
            "params": [
                {
                    "name": "stepped",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "animationLength",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TimeUpdateData"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 585,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "_setStartTime",
            "desc": "Manually sets currentStartTime and TimeKeeper's currentTime",
            "params": [
                {
                    "name": "newStartTime",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "timeKeeperTime",
                    "desc": "",
                    "lua_type": "number?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 742,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "_resetTimeKeeper",
            "desc": "Sets currentStartTime to currentTime and resets TimeKeeper's currentTime to 0",
            "params": [],
            "returns": [],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 751,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "_updateLinearTimeState",
            "desc": "Updates Linear TimeState (Playing)",
            "params": [
                {
                    "name": "stepped",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "animationLength",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "lastUpdateTime",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "currentState",
                    "desc": "",
                    "lua_type": "AnimationStateData"
                },
                {
                    "name": "lastState",
                    "desc": "",
                    "lua_type": "AnimationStateData"
                },
                {
                    "name": "hasStateChanged",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "wasCurrentTimeSet",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "hasTimeScaleChanged",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "hasUpdateDirectionChanged",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TimeUpdateState"
                },
                {
                    "desc": "",
                    "lua_type": "ReachedAnimationLengthType"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 767,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "_updateEasingTimeState",
            "desc": "Updates Easing TimeStates (PlayingEasing, PausingEasing, StoppingEasing)",
            "params": [
                {
                    "name": "stepped",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "animationLength",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "lastUpdateTime",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "currentState",
                    "desc": "",
                    "lua_type": "AnimationStateData"
                },
                {
                    "name": "lastState",
                    "desc": "",
                    "lua_type": "AnimationStateData"
                },
                {
                    "name": "hasStateChanged",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "wasCurrentTimeSet",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "hasTimeScaleChanged",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "hasUpdateDirectionChanged",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TimeUpdateState"
                },
                {
                    "desc": "",
                    "lua_type": "ReachedAnimationLengthType"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 919,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "_updateBoundUpdaterTimeState",
            "desc": "Updates bound animation player",
            "params": [
                {
                    "name": "boundUpdater",
                    "desc": "",
                    "lua_type": "TimeUpdater"
                },
                {
                    "name": "animationLength",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "lastUpdateTime",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TimeUpdateState"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1043,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "setCurrentTimeReducer",
            "desc": "Sets a function which processes the new current time after it has been updated by the TimeUpdater\nand returns a new time.\nUsed to set offset the current time.",
            "params": [
                {
                    "name": "reducer",
                    "desc": "",
                    "lua_type": "((currentTime: number) -> number)?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1073,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "_reduceCurrentTime",
            "desc": "Calls the currentTimeReducer, if exists, and sets the new time to the returned value",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "method",
            "errors": [
                {
                    "lua_type": "\"CurrentTimeReducer did not return a number!\"",
                    "desc": "Checks if timeReducer did return a number."
                }
            ],
            "private": true,
            "source": {
                "line": 1090,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "setCurrentTime",
            "desc": "Sets the currentTime of the TimeUpdater\nIf currentState is Stopped and keepState is not true, will change the\ncurrent state to Paused. This is so when state changes to Playing, it will\nresume from the new time instead of starting from 0.",
            "params": [
                {
                    "name": "newCurrentTime",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "keepState",
                    "desc": "",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1105,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "getLastTimeUpdateState",
            "desc": "Returns the last updated TimeUpdateState",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TimeUpdateState"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1124,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "getCurrentData",
            "desc": "Returns a snapshot of the current TimeUpdateData with all flags set to false",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TimeUpdateData"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1134,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "getCurrentState",
            "desc": "Returns the current state",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "AnimationState"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1203,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "getCurrentTime",
            "desc": "Returns the currentTime",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1209,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isLooping",
            "desc": "Returns .isLooped",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1215,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "getIsLooped",
            "desc": "Returns .isLooped",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1221,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "getTimeScale",
            "desc": "Returns .timeScale",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1227,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "getUpdateDirection",
            "desc": "Returns .updateDirection",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1233,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isActive",
            "desc": "Returns true if `currentState` will update time",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1239,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isInactive",
            "desc": "Returns true if `currentState` will NOT update time",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1245,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isPlaying",
            "desc": "Returns true if `currentState` is AnimationState.Playing",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1251,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isPaused",
            "desc": "Returns true if `currentState` is AnimationState.Paused",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1257,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isStopped",
            "desc": "Returns true if `currentState` is AnimationState.Stopped",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1263,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isEasing",
            "desc": "Returns true if `currentState` uses easing.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1269,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "setIsLooped",
            "desc": "Sets whether it will return to start when animation length is reached",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1275,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "setTimeScale",
            "desc": "Sets how fast time will move",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1283,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "setUpdateDirection",
            "desc": "Sets which direction time moves: forwards (true) or backwards (false).",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1291,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "restart",
            "desc": "Restarts the TimeUpdater.\nSets currentTime to 0 and currentState to Playing.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1299,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "play",
            "desc": "Sets the current state to Playing",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1305,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "pause",
            "desc": "Sets the current state to Paused",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1314,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "stop",
            "desc": "Sets the current state to Stopped",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1323,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "playWithEasing",
            "desc": "Tweens using the given state, then transitions to a Playing state\nSets the current state to PlayingEasing",
            "params": [
                {
                    "name": "tweenData",
                    "desc": "",
                    "lua_type": "TimeUpdaterTweenData"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1334,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "pauseWithEasing",
            "desc": "Tweens using the given state, then transitions to a Paused state\nSets the current state to PausingEasing",
            "params": [
                {
                    "name": "tweenData",
                    "desc": "",
                    "lua_type": "TimeUpdaterTweenData"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1344,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "stopWithEasing",
            "desc": "Tweens using the given state, then transitions to a Stopped state\nSets the current state to StoppingEasing",
            "params": [
                {
                    "name": "tweenData",
                    "desc": "",
                    "lua_type": "TimeUpdaterTweenData"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1354,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "setState",
            "desc": "Sets the current AnimationState",
            "params": [
                {
                    "name": "newState",
                    "desc": "",
                    "lua_type": "AnimationState"
                },
                {
                    "name": "tweenData",
                    "desc": "",
                    "lua_type": "TimeUpdaterTweenData?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1363,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "bindToUpdater",
            "desc": "Binds this time updater to the given time updater so that states transfer over\nbinding to a time updater should give that time updater control over this one's states\nit should not change time on playing from stop (tho this might be overwritten by the time reducer)\nwhen animation length is reached",
            "params": [
                {
                    "name": "timeUpdater",
                    "desc": "",
                    "lua_type": "TimeUpdater"
                },
                {
                    "name": "bindToUpdaterType",
                    "desc": "",
                    "lua_type": "BindToUpdaterType"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1389,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "unbindFromUpdater",
            "desc": "Unbinds the currently bound TimeUpdater",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1404,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "timeKeeper",
            "desc": "An object that helps with managing time updating",
            "lua_type": "TimeKeeper",
            "source": {
                "line": 203,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "currentTime",
            "desc": "The current time in seconds",
            "lua_type": "number",
            "source": {
                "line": 207,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "currentModelTime",
            "desc": "The current time used visually in seconds",
            "lua_type": "number",
            "source": {
                "line": 211,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "wasCurrentTimeSet",
            "desc": "If true, setCurrentTime was called between the last update",
            "lua_type": "boolean",
            "source": {
                "line": 215,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "currentState",
            "desc": "The current state of the TimeUpdater",
            "lua_type": "AnimationStateData",
            "source": {
                "line": 219,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "lastState",
            "desc": "The last updated state of the TimeUpdater",
            "lua_type": "AnimationStateData",
            "source": {
                "line": 223,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "currentStartTime",
            "desc": "An internal start time used for time keeping",
            "lua_type": "number",
            "source": {
                "line": 227,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "isLooped",
            "desc": "Determines whether time should restart at 0 when time reaches animationLength.\nOtherwise sets state to Stopped and currentTime to the animationLength.",
            "lua_type": "boolean",
            "source": {
                "line": 232,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "timeScale",
            "desc": "A value used to scale how fast time moves",
            "lua_type": "number",
            "source": {
                "line": 236,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "lastTimeScale",
            "desc": "",
            "lua_type": "number",
            "source": {
                "line": 239,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "updateDirection",
            "desc": "Determines which direction time moves, forwards (true) or backwards (false).",
            "lua_type": "boolean",
            "source": {
                "line": 243,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "lastUpdateDirection",
            "desc": "",
            "lua_type": "boolean",
            "source": {
                "line": 246,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "lastTimeUpdateState",
            "desc": "",
            "lua_type": "TimeUpdateState",
            "source": {
                "line": 249,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "lastReachedAnimationLengthType",
            "desc": "",
            "lua_type": "ReachedAnimationLengthType",
            "source": {
                "line": 252,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "currentTimeReducerOption",
            "desc": "An option for a reducer used to modify the currentTime every update\n*See :setCurrentTimeReducer()*",
            "lua_type": "Option<(currentTime: number) => number>",
            "source": {
                "line": 257,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "boundUpdaterData",
            "desc": "Data for the current bound updater",
            "lua_type": "{ type: BindToUpdaterType, timeUpdater: TimeUpdater } | nil",
            "source": {
                "line": 261,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "canChangeStateOnPlayingFromStopped",
            "desc": "Prevents state from changing from Playing to Stopped.\nUseful if state is controlled by another object (i.e. the server)",
            "lua_type": "boolean",
            "tags": [
                "setting"
            ],
            "source": {
                "line": 269,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "canChangeStateOnAnimationLengthReached",
            "desc": "Prevents looping or stopping TimeUpdater when it reaches the current animation's length.\nUseful if state is controlled by another object (i.e. the server)",
            "lua_type": "boolean",
            "tags": [
                "setting"
            ],
            "source": {
                "line": 277,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "canChangeStateOnEasingStateFinished",
            "desc": "Prevents state from changing when it finishes an easing state.\nUseful if state is controlled by another object (i.e. the server)",
            "lua_type": "boolean",
            "tags": [
                "setting"
            ],
            "source": {
                "line": 285,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "canResetTimeKeeper",
            "desc": "Prevents TimeKeeper from resetting on state or time changes.\nUseful if state is controlled by another object (i.e. the server)",
            "lua_type": "boolean",
            "tags": [
                "setting"
            ],
            "source": {
                "line": 293,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        }
    ],
    "types": [
        {
            "name": "AnimationState",
            "desc": "",
            "fields": [
                {
                    "name": "Playing",
                    "lua_type": "0",
                    "desc": ""
                },
                {
                    "name": "Paused",
                    "lua_type": "1",
                    "desc": ""
                },
                {
                    "name": "Stopped",
                    "lua_type": "2",
                    "desc": ""
                },
                {
                    "name": "PlayingEasing",
                    "lua_type": "3",
                    "desc": ""
                },
                {
                    "name": "PausingEasing",
                    "lua_type": "4",
                    "desc": ""
                }
            ],
            "tags": [
                "enum"
            ],
            "source": {
                "line": 28,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "ReachedAnimationLengthType",
            "desc": "",
            "fields": [
                {
                    "name": "None",
                    "lua_type": "0",
                    "desc": ""
                },
                {
                    "name": "Reached",
                    "lua_type": "1",
                    "desc": ""
                },
                {
                    "name": "Looped",
                    "lua_type": "2",
                    "desc": ""
                },
                {
                    "name": "Stopped",
                    "lua_type": "3",
                    "desc": ""
                }
            ],
            "tags": [
                "enum"
            ],
            "source": {
                "line": 54,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "BindToUpdaterType",
            "desc": "",
            "fields": [
                {
                    "name": "State",
                    "lua_type": "0",
                    "desc": ""
                },
                {
                    "name": "Time",
                    "lua_type": "1",
                    "desc": ""
                },
                {
                    "name": "StateAndTime",
                    "lua_type": "2",
                    "desc": ""
                }
            ],
            "tags": [
                "enum"
            ],
            "source": {
                "line": 72,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "TimeUpdaterTweenData",
            "desc": "Range will be from [start, start + length]\nDuration will be from [startDuration or 0, duration or endDuration]",
            "fields": [
                {
                    "name": "length",
                    "lua_type": "number",
                    "desc": "Amount of time that will be tweened."
                },
                {
                    "name": "duration",
                    "lua_type": "number",
                    "desc": "Total time this tween will last for"
                },
                {
                    "name": "startDuration",
                    "lua_type": "number?",
                    "desc": "Time this tween will start at. Default is 0."
                },
                {
                    "name": "endDuration",
                    "lua_type": "number?",
                    "desc": "Time this tween will stop at. Usually duration."
                },
                {
                    "name": "style",
                    "lua_type": "Enum.EasingStyle",
                    "desc": ""
                },
                {
                    "name": "direction",
                    "lua_type": "Enum.EasingDirection",
                    "desc": ""
                }
            ],
            "source": {
                "line": 92,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "AnimationStateData",
            "desc": "",
            "fields": [
                {
                    "name": "state",
                    "lua_type": "AnimationState",
                    "desc": ""
                },
                {
                    "name": "tweenData",
                    "lua_type": "TimeUpdaterTweenData | nil",
                    "desc": ""
                }
            ],
            "source": {
                "line": 117,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "TimeUpdateState",
            "desc": "State generated during an active or playing state.\nBasically the minimum time update data used for triggers.\nThis state is cached and can be used via bound updaters to get their state.",
            "fields": [
                {
                    "name": "currentTime",
                    "lua_type": "number",
                    "desc": "Current time"
                },
                {
                    "name": "previousTime",
                    "lua_type": "number",
                    "desc": "Last updated time"
                },
                {
                    "name": "currentModelTime",
                    "lua_type": "number",
                    "desc": "Current time used for visual (models)"
                },
                {
                    "name": "currentStartTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "currentTimeKeeperTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "lastTimeKeeperTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "animationLength",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "hasPassedLength",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "wasCurrentTimeSet",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "wasCurrentStartTimeSet",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "currentUpdateDirection",
                    "lua_type": "boolean",
                    "desc": ""
                }
            ],
            "source": {
                "line": 155,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "EasingUpdateData",
            "desc": "",
            "fields": [
                {
                    "name": "currentTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "currentModelTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "timeDelta",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "hasFinished",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "finishedDifference",
                    "lua_type": "number",
                    "desc": ""
                }
            ],
            "source": {
                "line": 434,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        },
        {
            "name": "TimeUpdateData",
            "desc": "Data generated during an update.\nExtends [TimeUpdateState](#TimeUpdateState)",
            "fields": [
                {
                    "name": "currentTime",
                    "lua_type": "number",
                    "desc": "Current time"
                },
                {
                    "name": "previousTime",
                    "lua_type": "number",
                    "desc": "Last updated time"
                },
                {
                    "name": "currentModelTime",
                    "lua_type": "number",
                    "desc": "Current time used for visual (models)"
                },
                {
                    "name": "currentStartTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "currentTimeKeeperTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "lastTimeKeeperTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "animationLength",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "hasPassedLength",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "wasCurrentTimeSet",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "wasCurrentStartTimeSet",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "currentUpdateDirection",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "currentState",
                    "lua_type": "AnimationStateData",
                    "desc": ""
                },
                {
                    "name": "hasStateChanged",
                    "lua_type": "boolean",
                    "desc": "If true, currentState is different from lastState in this update."
                },
                {
                    "name": "isLooped",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "hasIsLoopedChanged",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "timeScale",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "hasTimeScaleChanged",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "updateDirection",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "hasUpdateDirectionChanged",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "lastReachedAnimationLengthType",
                    "lua_type": "ReachedAnimationLengthType",
                    "desc": ""
                }
            ],
            "source": {
                "line": 548,
                "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
            }
        }
    ],
    "name": "TimeUpdater",
    "desc": "Manages the state and time changes for an AnimationPlayer",
    "source": {
        "line": 15,
        "path": "src/shared/animationPlayer/timeUpdater/TimeUpdater.lua"
    }
}