Click or drag to resize

ManagedUpdate Class

A relay for Unity update events. Here's why you might want to use this: https://blogs.unity3d.com/2015/12/23/1k-update-calls/ In short; avoid overhead of Native C++ --> Managed C# calls. Also useful for non-MonoBehaviours that needs to be part of the update loop as well. Built-in events your can subscribe to: You can also create your own custom update loops (eg. to run every nth second) using AddCustomUpdateLoop(ICustomUpdateLoop, UpdateLoop, Int32) and AddListener(Int32, Action, Int32).
Inheritance Hierarchy
SystemObject
  Archon.SwissArmyLib.Events.LoopsManagedUpdate

Namespace:  Archon.SwissArmyLib.Events.Loops
Assembly:  Archon.SwissArmyLib (in Archon.SwissArmyLib.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static class ManagedUpdate
Request Example View Source

The ManagedUpdate type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberDeltaTime
Gets the difference in seconds since the previous update of the currently running type. (Scaled according to timeScale)
Public propertyStatic memberUnscaledDeltaTime
Gets the unscaled difference in seconds since the previous update of the currently running type.
Top
Methods
  NameDescription
Public methodStatic memberAddCustomUpdateLoop
Adds a custom update loop.
Public methodStatic memberAddListener(Int32, IEventListener, Int32)
Adds a listener for an update loop. If it's not a custom update loop, you can instead subscribe directly using OnUpdate, OnLateUpdate or OnFixedUpdate.
Public methodStatic memberAddListener(Int32, Action, Int32)
Adds a listener for an update loop. If it's not a custom update loop, you can instead subscribe directly using OnUpdate, OnLateUpdate or OnFixedUpdate.
Public methodStatic memberGetCustomUpdateLoop(Int32)
Gets the custom update loop implementation for the given event id.
Public methodStatic memberGetCustomUpdateLoopT(Int32)
Gets the custom update loop implementation for the given event id.
Public methodStatic memberRemoveCustomUpdateLoop(Int32)
Removes a custom update loop with the given event id.
Public methodStatic memberRemoveCustomUpdateLoop(ICustomUpdateLoop)
Removes a custom update loop.
Public methodStatic memberRemoveListener(Int32, IEventListener)
Removes a listener for an update loop. If it's not a custom update loop, you can instead unsubscribe directly using OnUpdate, OnLateUpdate or OnFixedUpdate.
Public methodStatic memberRemoveListener(Int32, Action)
Removes a listener for an update loop. If it's not a custom update loop, you can instead unsubscribe directly using OnUpdate, OnLateUpdate or OnFixedUpdate.
Top
Fields
  NameDescription
Public fieldStatic memberOnFixedUpdate
Event handler that is called every fixed update.
Public fieldStatic memberOnLateUpdate
Event handler that is called every update but after the regular Update.
Public fieldStatic memberOnUpdate
Event handler that is called every update.
Top
See Also