add VRMShaders.Symbols

This commit is contained in:
ousttrue
2021-12-09 16:34:44 +09:00
parent e09c1b8df6
commit 569e0ca147
4 changed files with 41 additions and 8 deletions

View File

@@ -117,12 +117,13 @@ namespace UniVRM10
case Vrm10FileType.Vrm0:
EditorGUILayout.HelpBox(m_result.Message, m_model != null ? MessageType.Info : MessageType.Warning);
#if VRM_DEVELOP
if (GUILayout.Button("debug export"))
if (VRMShaders.Symbols.VRM_DEVELOP)
{
File.WriteAllBytes("tmp.vrm", m_result.MigratedBytes);
if (GUILayout.Button("debug export"))
{
File.WriteAllBytes("tmp.vrm", m_result.MigratedBytes);
}
}
#endif
// migration check boxs
base.OnInspectorGUI();

View File

@@ -120,10 +120,13 @@ namespace UniVRM10
throw new NullReferenceException("oldMeta");
}
result = new Vrm10Data(migratedData, vrm, Vrm10FileType.Vrm0, "vrm0: migrated", oldMeta);
#if VRM_DEVELOP
// 右手左手座標変換でバッファが破壊的変更されるので、コピーを作っている
result.MigratedBytes = migrated.Select(x => x).ToArray();
#endif
if (VRMShaders.Symbols.VRM_DEVELOP)
{
// 右手左手座標変換でバッファが破壊的変更されるので、コピーを作っている
result.MigratedBytes = migrated.Select(x => x).ToArray();
}
return true;
}

View File

@@ -0,0 +1,18 @@
namespace VRMShaders
{
public static class Symbols
{
/// <summary>
/// #if 文を局所化する。
/// VRMShaders が最下層になるため、ここに配置している
/// </summary>
/// <value></value>
public const bool VRM_DEVELOP =
#if VRM_DEVELOP
true
#else
false
#endif
;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ffb4175afef01ea48ad7669a8b12d93f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: