Created
November 16, 2025 15:31
-
-
Save griffi-gh/ac27c4cdbe220d70d9db93c2e17b3240 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using. /Verse.org | |
| using. /Verse.org/Native | |
| using. /Verse.org/SceneGraph | |
| using. /Verse.org/Simulation | |
| tickable<public> := interface() { | |
| var Cancelable_PreTick<private>: ?cancelable = false; | |
| var Cancelable_PostTick<private>: ?cancelable = false; | |
| OnBeginSimulation<public>(Component: component):void = | |
| TickEvents := Component.GetTickEvents(); | |
| set Cancelable_PreTick = option. TickEvents.PrePhysics.Subscribe(OnPreTick); # <- ignore error here | |
| set Cancelable_PostTick = option. TickEvents.PostPhysics.Subscribe(OnPostTick); # <- ignore error here | |
| OnEndSimulation<public>(Component: component):void = | |
| if (Cancelable := Cancelable_PreTick?). Cancelable.Cancel(); | |
| if (Cancelable := Cancelable_PostTick?). Cancelable.Cancel(); | |
| set Cancelable_PreTick = false; | |
| set Cancelable_PostTick = false; | |
| OnPreTick<public>(Dt: float): void = {} | |
| OnPostTick<public>(Dt: float): void = {} | |
| } | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example usage: