whydoidoit / delay

Simple promise for a callback after a delay in PlayCanvas, delay is measured in game time which may be stretched or paused.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

Creates a promise for a game time delay in PlayCanvas

Installation

npm install --save playcanvas-delay

Usage

import delay from 'playcanvas-delay'

...

await delay(0.5 * 1000);

delay(6000).then(function() { ... }); 

Requirements

Requires PlayCanvas Engine to be running on the page. Uses ES6/Babel/PlayCanvas template.

About

Simple promise for a callback after a delay in PlayCanvas, delay is measured in game time which may be stretched or paused.


Languages

Language:JavaScript 100.0%