Skip to content

SceneTreeTimer

eduardgushchin edited this page Oct 2, 2026 · 2 revisions

Home | API by Category | Complete API Index | API Status

Field Value
Full name Electron2D.SceneTreeTimer
Namespace Electron2D
Kind class
Category API Scene

Overview

Provides a lightweight one-shot timer processed by a Electron2D.SceneTree.

Syntax

public sealed class Electron2D.SceneTreeTimer

Remarks

The owning tree updates the timer after node callbacks in the selected frame lane. The timer is automatically disposed after timeout delivery. Keeping a managed reference does not extend its lifetime. Time advances only from delivered frame deltas; Electron2D.Engine supplies both scaled and original deltas when it drives the tree. The timer has no internal clock.

Inherits: ElectronObject

Detailed engine reference

Members

Member Kind Summary
public event System.Action<Electron2D.SceneTreeTimer> Timeout event Occurs once when the remaining delay reaches zero.
protected override System.Void Dispose(System.Boolean disposing) method
protected override System.Collections.Generic.IEnumerable<Electron2D.PropertyDescriptor> GetPropertyDescriptors() method
protected override System.Void ValidateDisposal() method
public System.Double TimeLeft { get; set; } property Gets or sets the remaining delay in seconds.

Member Details

Timeout

Kind: event

public event System.Action<Electron2D.SceneTreeTimer> Timeout

Summary

Occurs once when the remaining delay reaches zero.

Remarks

Delivery is synchronous on the tree owner thread after node callbacks and before deferred work. The timer is disposed after the event invocation returns or throws. A handler failure propagates through the owning frame as part of an System.AggregateException.

Dispose(System.Boolean)

Kind: method

protected override System.Void Dispose(System.Boolean disposing)

Remarks

Removes the timer from its tree, clears timeout subscribers, and calls the base implementation.

GetPropertyDescriptors()

Kind: method

protected override System.Collections.Generic.IEnumerable<Electron2D.PropertyDescriptor> GetPropertyDescriptors()

Remarks

Appends this class's remaining-time and processing-policy descriptors.

ValidateDisposal()

Kind: method

protected override System.Void ValidateDisposal()

Remarks

Requires the owner thread while this timer remains owned by a scene tree.

Exceptions

  • T:System.InvalidOperationException: The caller is not the owner thread.

TimeLeft

Kind: property

public System.Double TimeLeft { get; set; }

Summary

Gets or sets the remaining delay in seconds.

Remarks

Changing the value does not change the timer's selected frame lane or pause policy. Zero expires on the next matching frame.

Value

A finite non-negative duration. It reaches zero before Electron2D.SceneTreeTimer.Timeout is raised.

Exceptions

  • T:System.ArgumentOutOfRangeException: The assigned value is negative, NaN, or infinite.
  • T:System.InvalidOperationException: An attached timer is mutated off its tree's owner thread.
  • T:System.ObjectDisposedException: The timer is disposing on another thread or has finished disposing.

Clone this wiki locally