You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 23:16:20 +00:00
30 lines
488 B
TypeScript
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;
|
|
}
|
|
}
|
|
} |