Merge pull request #1904 from Santarh/suppressPreprocessor

Use static getter instead of preprocessors.
This commit is contained in:
ousttrue
2022-11-04 14:06:37 +09:00
committed by GitHub
18 changed files with 119 additions and 91 deletions

View File

@@ -118,10 +118,11 @@ namespace VRM
{
if (!string.IsNullOrEmpty(AssetDatabase.GetAssetPath(o)))
{
#if VRM_DEVELOP
// 来ない?
Debug.LogWarning($"{o} already exists. skip write");
#endif
if (Symbols.VRM_DEVELOP)
{
// 来ない?
Debug.LogWarning($"{o} already exists. skip write");
}
return;
}

View File

@@ -1,15 +1,10 @@
using System.Collections;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using System.Reflection;
using System;
#if UNITY_EDITOR
using UnityEditor;
#endif
using VRMShaders;
using UniGLTF;
namespace VRM
{
/// <summary>
@@ -56,14 +51,17 @@ namespace VRM
// HideFlags are special editor-only settings that let you have *secret* GameObjects in a scene, or to tell Unity not to save that temporary GameObject as part of the scene
foreach (var x in go.transform.Traverse())
{
x.gameObject.hideFlags = HideFlags.None
| HideFlags.DontSave
//| HideFlags.DontSaveInBuild
#if VRM_DEVELOP
#else
| HideFlags.HideAndDontSave
#endif
;
if (Symbols.VRM_DEVELOP)
{
x.gameObject.hideFlags = HideFlags.None |
HideFlags.DontSave;
}
else
{
x.gameObject.hideFlags = HideFlags.None |
HideFlags.DontSave |
HideFlags.HideAndDontSave;
}
}
return manager;

View File

@@ -22,9 +22,10 @@ namespace VRM
// pbr "Standard" to "Universal Render Pipeline/Lit"
if (GltfPbrUrpMaterialImporter.TryCreateParam(data, i, out matDesc)) return matDesc;
// fallback
#if VRM_DEVELOP
Debug.LogWarning($"material: {i} out of range. fallback");
#endif
if (Symbols.VRM_DEVELOP)
{
Debug.LogWarning($"material: {i} out of range. fallback");
}
return new MaterialDescriptor(
GltfMaterialDescriptorGenerator.GetMaterialName(i, null),
GltfPbrMaterialImporter.ShaderName,