Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private setupRunner() {
// Main label at the top of the stage
this.contextLabel = MRE.Actor.Create(this.context, {
actor: {
name: 'contextLabel',
text: {
contents: this.activeTestName,
height: 0.2,
anchor: MRE.TextAnchorLocation.MiddleCenter,
justify: MRE.TextJustify.Center,
color: NeutralColor
},
transform: {
local: {
position: { y: 1.8 }
}
}
}
});
this.testRoot = MRE.Actor.Create(this.context, {
actor: {
name: 'testRoot',
exclusiveToUser: this.exclusiveUser && this.exclusiveUser.id || undefined
}
});
}
});
this.playPauseText = MRE.Actor.Create(this.context, {
actor: {
parentId: this.playPauseButton.id,
transform: {
local: {
position: { z: -0.1 }
}
},
text: {
contents: "Start",
height: 0.15,
anchor: MRE.TextAnchorLocation.MiddleCenter,
justify: MRE.TextJustify.Center,
color: NeutralColor
}
}
});
this.playPauseButton.setBehavior(MRE.ButtonBehavior)
.onButton("released", user => {
if (this.activeTest === null) {
this.runTest(user);
} else {
this.stopTest().catch(() => { });
}
});
const menuButton = MRE.Actor.Create(this.context, {
actor: {
name: `${bodyName}-body`,
parentId: obliquity1.value.id,
transform: {
local: { scale: scaleValue }
}
}
});
label.value.enableText({
contents: bodyName,
height: 0.5,
pixelsPerLine: 50,
color: MRESDK.Color3.Yellow(),
anchor: MRESDK.TextAnchorLocation.TopCenter,
justify: MRESDK.TextJustify.Center,
});
setTimeout(() => {
label.value.text.color = MRESDK.Color3.White();
}, 5000);
this.celestialBodies[bodyName] = {
inclination: inclination.value,
position: position.value,
obliquity0: obliquity0.value,
obliquity1: obliquity1.value,
model: model.value
} as CelestialBody;
this.createAnimations(bodyName);
} catch (e) {
actor: {
name: `${bodyName}-body`,
parentId: obliquity1.value.id,
transform: {
scale: scaleValue
}
}
});
label.value.enableText({
contents: bodyName,
height: 0.5,
pixelsPerLine: 50,
color: MRESDK.Color3.Yellow(),
anchor: MRESDK.TextAnchorLocation.TopCenter,
justify: MRESDK.TextJustify.Center,
});
setTimeout(() => {
label.value.text.color = MRESDK.Color3.White();
}, 5000);
this.celestialBodies[bodyName] = {
inclination: inclination.value,
position: position.value,
obliquity0: obliquity0.value,
obliquity1: obliquity1.value,
model: model.value
} as CelestialBody;
this.createAnimations(bodyName);
} catch (e) {