Skip to content

Commit

Permalink
Migrate framework scene and resources folders to single quotes (#4167)
Browse files Browse the repository at this point in the history
  • Loading branch information
willeastcott authored Apr 4, 2022
1 parent 24e58e3 commit 13c52d0
Show file tree
Hide file tree
Showing 89 changed files with 1,030 additions and 1,030 deletions.
4 changes: 2 additions & 2 deletions src/framework/components/anim/component-binder.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ class AnimComponentBinder extends DefaultAnimBinder {
const key = path[path.length - 1];

// if the object has a setter function, use it
const setterFuncName = "set" + key.substring(0, 1).toUpperCase() + key.substring(1);
const setterFuncName = 'set' + key.substring(0, 1).toUpperCase() + key.substring(1);
if (obj[setterFuncName]) {
// if the object has a setter function, use it
const getterFunc = obj["get" + key.substring(0, 1).toUpperCase() + key.substring(1)].bind(obj);
const getterFunc = obj['get' + key.substring(0, 1).toUpperCase() + key.substring(1)].bind(obj);
let baseValues = getterFunc();
baseValues = [baseValues.x, baseValues.y, baseValues.z, baseValues.w];
const setterFunc = obj[setterFuncName].bind(obj);
Expand Down
58 changes: 29 additions & 29 deletions src/framework/components/anim/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { AnimComponentBinder } from './component-binder.js';
import { AnimComponentLayer } from './component-layer.js';
import { AnimStateGraph } from '../../../anim/state-graph/anim-state-graph.js';
import { AnimEvents } from '../../../anim/evaluator/anim-events.js';
import { Entity } from "../../entity.js";
import { Entity } from '../../entity.js';

/** @typedef {import('./system.js').AnimComponentSystem} AnimComponentSystem */

Expand Down Expand Up @@ -318,8 +318,8 @@ class AnimComponent extends Component {
if (layer) return layer;
const states = [
{
"name": "START",
"speed": 1
'name': 'START',
'speed': 1
}
];
const transitions = [];
Expand Down Expand Up @@ -501,30 +501,30 @@ class AnimComponent extends Component {
addAnimationState(nodeName, animTrack, speed = 1, loop = true, layerName = 'Base') {
if (!this._stateGraph) {
this.loadStateGraph(new AnimStateGraph({
"layers": [
'layers': [
{
"name": layerName,
"states": [
'name': layerName,
'states': [
{
"name": "START",
"speed": 1
'name': 'START',
'speed': 1
},
{
"name": nodeName,
"speed": speed,
"loop": loop,
"defaultState": true
'name': nodeName,
'speed': speed,
'loop': loop,
'defaultState': true
}
],
"transitions": [
'transitions': [
{
"from": 'START',
"to": nodeName
'from': 'START',
'to': nodeName
}
]
}
],
"parameters": {}
'parameters': {}
}));
}
const layer = this.findAnimationLayer(layerName);
Expand Down Expand Up @@ -558,30 +558,30 @@ class AnimComponent extends Component {
assignAnimation(nodePath, animTrack, layerName, speed = 1, loop = true) {
if (!this._stateGraph && nodePath.indexOf('.') === -1) {
this.loadStateGraph(new AnimStateGraph({
"layers": [
'layers': [
{
"name": "Base",
"states": [
'name': 'Base',
'states': [
{
"name": "START",
"speed": 1
'name': 'START',
'speed': 1
},
{
"name": nodePath,
"speed": speed,
"loop": loop,
"defaultState": true
'name': nodePath,
'speed': speed,
'loop': loop,
'defaultState': true
}
],
"transitions": [
'transitions': [
{
"from": 'START',
"to": nodePath
'from': 'START',
'to': nodePath
}
]
}
],
"parameters": {}
'parameters': {}
}));
this.baseLayer.assignAnimation(nodePath, animTrack);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/audio-listener/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AudioListenerComponentSystem extends ComponentSystem {
constructor(app, manager) {
super(app);

this.id = "audiolistener";
this.id = 'audiolistener';

this.ComponentType = AudioListenerComponent;
this.DataType = AudioListenerComponentData;
Expand Down
20 changes: 10 additions & 10 deletions src/framework/components/audio-source/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ class AudioSourceComponent extends Component {
constructor(system, entity) {
super(system, entity);

this.on("set_assets", this.onSetAssets, this);
this.on("set_loop", this.onSetLoop, this);
this.on("set_volume", this.onSetVolume, this);
this.on("set_pitch", this.onSetPitch, this);
this.on("set_minDistance", this.onSetMinDistance, this);
this.on("set_maxDistance", this.onSetMaxDistance, this);
this.on("set_rollOffFactor", this.onSetRollOffFactor, this);
this.on("set_distanceModel", this.onSetDistanceModel, this);
this.on("set_3d", this.onSet3d, this);
this.on('set_assets', this.onSetAssets, this);
this.on('set_loop', this.onSetLoop, this);
this.on('set_volume', this.onSetVolume, this);
this.on('set_pitch', this.onSetPitch, this);
this.on('set_minDistance', this.onSetMinDistance, this);
this.on('set_maxDistance', this.onSetMaxDistance, this);
this.on('set_rollOffFactor', this.onSetRollOffFactor, this);
this.on('set_distanceModel', this.onSetDistanceModel, this);
this.on('set_3d', this.onSet3d, this);
}

/**
Expand Down Expand Up @@ -351,7 +351,7 @@ class AudioSourceComponent extends Component {
_done();
}
// but if they are added insert them into source list
this.system.app.assets.on("add:" + ids[index], (asset) => {
this.system.app.assets.on('add:' + ids[index], (asset) => {
asset.ready((asset) => {
this.data.sources[asset.name] = asset.resource;
});
Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/audio-source/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AudioSourceComponentSystem extends ComponentSystem {
constructor(app, manager) {
super(app);

this.id = "audiosource";
this.id = 'audiosource';

this.ComponentType = AudioSourceComponent;
this.DataType = AudioSourceComponentData;
Expand Down
28 changes: 14 additions & 14 deletions src/framework/components/camera/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@ class CameraComponent extends Component {

onLayersChanged(oldComp, newComp) {
this.addCameraToLayers();
oldComp.off("add", this.onLayerAdded, this);
oldComp.off("remove", this.onLayerRemoved, this);
newComp.on("add", this.onLayerAdded, this);
newComp.on("remove", this.onLayerRemoved, this);
oldComp.off('add', this.onLayerAdded, this);
oldComp.off('remove', this.onLayerRemoved, this);
newComp.on('add', this.onLayerAdded, this);
newComp.on('remove', this.onLayerRemoved, this);
}

onLayerAdded(layer) {
Expand All @@ -458,10 +458,10 @@ class CameraComponent extends Component {

system.addCamera(this);

scene.on("set:layers", this.onLayersChanged, this);
scene.on('set:layers', this.onLayersChanged, this);
if (layers) {
layers.on("add", this.onLayerAdded, this);
layers.on("remove", this.onLayerRemoved, this);
layers.on('add', this.onLayerAdded, this);
layers.on('remove', this.onLayerRemoved, this);
}

if (this.enabled && this.entity.enabled) {
Expand All @@ -480,10 +480,10 @@ class CameraComponent extends Component {

this.removeCameraFromLayers();

scene.off("set:layers", this.onLayersChanged, this);
scene.off('set:layers', this.onLayersChanged, this);
if (layers) {
layers.off("add", this.onLayerAdded, this);
layers.off("remove", this.onLayerRemoved, this);
layers.off('add', this.onLayerAdded, this);
layers.off('remove', this.onLayerRemoved, this);
}

system.removeCamera(this);
Expand Down Expand Up @@ -574,7 +574,7 @@ class CameraComponent extends Component {
}

if (!this.system.app.vr) {
callback("VrManager not created. Enable VR in project settings.");
callback('VrManager not created. Enable VR in project settings.');
return;
}

Expand Down Expand Up @@ -606,7 +606,7 @@ class CameraComponent extends Component {
callback();
}
} else {
callback("No pc.VrDisplay to present");
callback('No pc.VrDisplay to present');
}
}

Expand Down Expand Up @@ -638,7 +638,7 @@ class CameraComponent extends Component {
callback();
}
} else {
callback("Not presenting VR");
callback('Not presenting VR');
}
}

Expand Down Expand Up @@ -717,7 +717,7 @@ class CameraComponent extends Component {
*/
endXr(callback) {
if (!this._camera.xr) {
if (callback) callback(new Error("Camera is not in XR"));
if (callback) callback(new Error('Camera is not in XR'));
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/camera/post-effect-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ class PostEffectQueue {
const len = this.effects.length;
if (len) {

DebugGraphics.pushGpuMarker(this.app.graphicsDevice, "Postprocess");
DebugGraphics.pushGpuMarker(this.app.graphicsDevice, 'Postprocess');

for (let i = 0; i < len; i++) {
const fx = this.effects[i];
Expand Down
8 changes: 4 additions & 4 deletions src/framework/components/collision/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ class CollisionComponent extends Component {
this.on('set_radius', this.onSetRadius, this);
this.on('set_height', this.onSetHeight, this);
this.on('set_axis', this.onSetAxis, this);
this.on("set_asset", this.onSetAsset, this);
this.on("set_renderAsset", this.onSetRenderAsset, this);
this.on("set_model", this.onSetModel, this);
this.on("set_render", this.onSetRender, this);
this.on('set_asset', this.onSetAsset, this);
this.on('set_renderAsset', this.onSetRenderAsset, this);
this.on('set_model', this.onSetModel, this);
this.on('set_render', this.onSetRender, this);
}

// Events Documentation
Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/collision/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ class CollisionMeshSystemImpl extends CollisionSystemImpl {
});
assets.load(asset);
} else {
assets.once("add:" + id, (asset) => {
assets.once('add:' + id, (asset) => {
asset.ready((asset) => {
data[property] = asset.resource;
this.doRecreatePhysicalShape(component);
Expand Down Expand Up @@ -580,7 +580,7 @@ class CollisionComponentSystem extends ComponentSystem {
constructor(app) {
super(app);

this.id = "collision";
this.id = 'collision';

this.ComponentType = CollisionComponent;
this.DataType = CollisionComponentData;
Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class Component extends EventHandler {
this.buildAccessors(this.system.schema);
}

this.on("set", function (name, oldValue, newValue) {
this.fire("set_" + name, name, oldValue, newValue);
this.on('set', function (name, oldValue, newValue) {
this.fire('set_' + name, name, oldValue, newValue);
});

this.on('set_enabled', this.onSetEnabled, this);
Expand Down
Loading

0 comments on commit 13c52d0

Please sign in to comment.