fix: world fixed object breaks android builds (#629)

Closes: #581
This commit is contained in:
bd_ 2024-01-28 20:13:33 +09:00 committed by GitHub
parent 1fc9c2d4ac
commit 94170179ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 2 deletions

View File

@ -264,5 +264,7 @@
"setup_outfit.err.no_outfit_hips": "Unable to identify the Hips object for the outfit. Searched for objects containing the following names:",
"move_independently.group-header": "Objects to move together",
"scale_adjuster.scale": "Scale adjustment",
"scale_adjuster.adjust_children": "Adjust position of child objects"
"scale_adjuster.adjust_children": "Adjust position of child objects",
"world_fixed_object.err.unsupported_platform": "World Fixed Object is not supported on this platform",
"world_fixed_object.err.unsupported_platform:description": "World Fixed Object is not supported on Android builds and will be ignored."
}

View File

@ -218,5 +218,7 @@
"setup_outfit.err.no_outfit_hips": "衣装のHipsボーンを発見できませんでした。以下の名前を含むボーンを探しました",
"move_independently.group-header": "一緒に動かすオブジェクト",
"scale_adjuster.scale": "Scale調整値",
"scale_adjuster.adjust_children": "子オブジェクトの位置を調整"
"scale_adjuster.adjust_children": "子オブジェクトの位置を調整",
"world_fixed_object.err.unsupported_platform": "World Fixed Objectがこのプラットフォームに対応していません",
"world_fixed_object.err.unsupported_platform:description": "World Fixed ObjectはAndroid向けビルドには対応していないため、動作しません。"
}

View File

@ -1,5 +1,6 @@
using System.Linq;
using nadena.dev.modular_avatar.editor.ErrorReporting;
using nadena.dev.ndmf;
using UnityEditor;
using UnityEngine;
using UnityEngine.Animations;
@ -30,6 +31,17 @@ namespace nadena.dev.modular_avatar.core.editor
void Process(ModularAvatarWorldFixedObject target)
{
switch (EditorUserBuildSettings.activeBuildTarget)
{
case BuildTarget.StandaloneWindows:
case BuildTarget.StandaloneWindows64:
case BuildTarget.StandaloneLinux64: // for CI
break;
default:
BuildReport.Log(ErrorSeverity.NonFatal, "world_fixed_object.err.unsupported_platform");
return;
}
var retargeter = new ActiveAnimationRetargeter(
_context,
new BoneDatabase(),