mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-25 01:33:51 +02:00
31 lines
922 B
JavaScript
31 lines
922 B
JavaScript
/**
|
|
* @param {object} unityPackages
|
|
* @returns {{ isPC: boolean, isQuest: boolean, isIos: boolean }}
|
|
*/
|
|
function getAvailablePlatforms(unityPackages) {
|
|
let isPC = false;
|
|
let isQuest = false;
|
|
let isIos = false;
|
|
if (typeof unityPackages === 'object') {
|
|
for (const unityPackage of unityPackages) {
|
|
if (
|
|
unityPackage.variant &&
|
|
unityPackage.variant !== 'standard' &&
|
|
unityPackage.variant !== 'security'
|
|
) {
|
|
continue;
|
|
}
|
|
if (unityPackage.platform === 'standalonewindows') {
|
|
isPC = true;
|
|
} else if (unityPackage.platform === 'android') {
|
|
isQuest = true;
|
|
} else if (unityPackage.platform === 'ios') {
|
|
isIos = true;
|
|
}
|
|
}
|
|
}
|
|
return { isPC, isQuest, isIos };
|
|
}
|
|
|
|
export { getAvailablePlatforms };
|