Files
Nitro_Render_V3/packages/utils/src/motion/Callback.ts
T
2024-04-03 09:27:56 +02:00

30 lines
488 B
TypeScript

import { Motion } from './Motion';
export class Callback extends Motion
{
protected _callback: Function;
constructor(k: Function)
{
super(null);
this._callback = k;
}
public get running(): boolean
{
return (this._running && !!this._callback);
}
public tick(k: number): void
{
super.tick(k);
if(this._callback)
{
this._callback();
this._callback = null;
}
}
}