mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-20 09:34:42 -05:00
add Axes.Default
This commit is contained in:
@@ -10,19 +10,12 @@ namespace UniGLTF
|
||||
[PreferenceItem("UniGLTF")]
|
||||
private static void OnPreferenceGUI()
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
// language
|
||||
M17N.LanguageGetter.OnGuiSelectLang();
|
||||
EditorGUILayout.HelpBox($"Custom editor language setting", MessageType.Info, true);
|
||||
|
||||
// default axis
|
||||
GltfIOAxis = (Axes)EditorGUILayout.EnumPopup("Default Invert axis", GltfIOAxis);
|
||||
EditorGUILayout.HelpBox($"Default invert axis when glb/gltf import/export", MessageType.Info, true);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
}
|
||||
ToggleSymbol("Use X axis for default invert axis", "UNIGLTF_DEFAULT_AXES_X");
|
||||
}
|
||||
|
||||
const string AXIS_KEY = "UNIGLTF_IO_AXIS";
|
||||
@@ -64,9 +57,8 @@ namespace UniGLTF
|
||||
var target = EditorUserBuildSettings.selectedBuildTargetGroup;
|
||||
var current = PlayerSettings.GetScriptingDefineSymbolsForGroup(target).Split(';');
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(target,
|
||||
string.Join(";", current.Concat(new[] { symbol }))
|
||||
string.Join(";", current.Concat(new[] { symbol }))
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public static void RemoveSymbol(string symbol)
|
||||
|
||||
@@ -5,13 +5,9 @@ namespace UniGLTF
|
||||
{
|
||||
public enum Axes
|
||||
{
|
||||
#if UNIGLTF_DEFAULT_AXES_X
|
||||
X,
|
||||
Z,
|
||||
#else
|
||||
Default,
|
||||
Z,
|
||||
X,
|
||||
#endif
|
||||
}
|
||||
|
||||
public interface IAxisInverter
|
||||
@@ -72,6 +68,15 @@ namespace UniGLTF
|
||||
{
|
||||
public static IAxisInverter Create(this Axes axis)
|
||||
{
|
||||
if (axis == Axes.Default)
|
||||
{
|
||||
#if UNIGLTF_DEFAULT_AXES_X
|
||||
axis = Axes.X;
|
||||
#else
|
||||
axis = Axes.Z;
|
||||
#endif
|
||||
}
|
||||
|
||||
switch (axis)
|
||||
{
|
||||
case Axes.Z: return new ReverseZ();
|
||||
|
||||
Reference in New Issue
Block a user