forked from LeenkxTeam/LNXSDK
moisesjpelaez - Add fixedUpdate for Physics
This commit is contained in:
@ -16,6 +16,7 @@ class Trait {
|
|||||||
var _remove: Array<Void->Void> = null;
|
var _remove: Array<Void->Void> = null;
|
||||||
var _update: Array<Void->Void> = null;
|
var _update: Array<Void->Void> = null;
|
||||||
var _lateUpdate: Array<Void->Void> = null;
|
var _lateUpdate: Array<Void->Void> = null;
|
||||||
|
var _fixedUpdate: Array<Void->Void> = null;
|
||||||
var _render: Array<kha.graphics4.Graphics->Void> = null;
|
var _render: Array<kha.graphics4.Graphics->Void> = null;
|
||||||
var _render2D: Array<kha.graphics2.Graphics->Void> = null;
|
var _render2D: Array<kha.graphics2.Graphics->Void> = null;
|
||||||
|
|
||||||
@ -87,6 +88,23 @@ class Trait {
|
|||||||
App.removeLateUpdate(f);
|
App.removeLateUpdate(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Add fixed game logic handler.
|
||||||
|
**/
|
||||||
|
public function notifyOnFixedUpdate(f: Void->Void) {
|
||||||
|
if (_fixedUpdate == null) _fixedUpdate = [];
|
||||||
|
_fixedUpdate.push(f);
|
||||||
|
App.notifyOnFixedUpdate(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Remove fixed game logic handler.
|
||||||
|
**/
|
||||||
|
public function removeFixedUpdate(f: Void->Void) {
|
||||||
|
_fixedUpdate.remove(f);
|
||||||
|
App.removeFixedUpdate(f);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Add render handler.
|
Add render handler.
|
||||||
**/
|
**/
|
||||||
|
Reference in New Issue
Block a user