Given this boiler plate ES5 example:
var Turning = pc.createScript('turn');
// define `speed` attribute that is available in Editor UI
Turning.attributes.add('speed', {
type: 'number',
default: 180,
placeholder: 'deg/s'
});
// runs every tick
Turning.prototype.update = function(dt) {
this.entity.rotate(0, this.speed * dt, 0);
};
How would you write it using the new ES6 features such as arrow functions, classes etc.?