Playcanvas: Fix lint (#22808)

This commit is contained in:
Andy
2018-01-10 12:23:08 -08:00
committed by GitHub
parent 5a4e3cece2
commit c72985cddb
3 changed files with 12 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
// Type definitions for playcanvas 0.221.0-dev
// Project: https://github.com/playcanvas/engine
// Type definitions for playcanvas 0.221
// Project: https://github.com/playcanvas/engine
// Definitions by: Philippe Vaillancourt <https://github.com/Neoflash1979>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

View File

@@ -1,6 +1,6 @@
// create a PlayCanvas application
var canvas = document.getElementById('application') as HTMLCanvasElement;
var app = new pc.Application(canvas, { });
const canvas = document.getElementById('application') as HTMLCanvasElement;
const app = new pc.Application(canvas, { });
app.start();
// fill the available space at full resolution
@@ -8,24 +8,24 @@ app.setCanvasFillMode(pc.FILLMODE_FILL_WINDOW);
app.setCanvasResolution(pc.RESOLUTION_AUTO);
// ensure canvas is resized when window changes size
window.addEventListener('resize', function() {
window.addEventListener('resize', () => {
app.resizeCanvas();
});
// create box entity
var cube = new pc.Entity('cube');
const cube = new pc.Entity('cube');
cube.addComponent('model', {
type: 'box'
});
// create camera entity
var camera = new pc.Entity('camera');
const camera = new pc.Entity('camera');
camera.addComponent('camera', {
clearColor: new pc.Color(0.1, 0.1, 0.1)
});
// create directional light entity
var light = new pc.Entity('light');
const light = new pc.Entity('light');
light.addComponent('light');
// add to hierarchy
@@ -38,6 +38,6 @@ camera.setPosition(0, 0, 3);
light.setEulerAngles(45, 0, 0);
// register a global update event
app.on('update', function (deltaTime) {
app.on('update', deltaTime => {
cube.rotate(10 * deltaTime, 20 * deltaTime, 30 * deltaTime);
});
});

View File

@@ -2,7 +2,8 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,