Merge pull request #2194 from ousttrue/fix/build_errors

build error を修正
This commit is contained in:
ousttrue 2023-12-12 21:06:08 +09:00 committed by GitHub
commit dd2847324f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 43 additions and 23 deletions

View File

@ -238,6 +238,16 @@ namespace UniGLTF.MeshUtility
}
}
Mesh WriteAndReload(Mesh src, string assetPath)
{
Debug.LogFormat("CreateAsset: {0}", assetPath);
AssetDatabase.CreateAsset(src, assetPath);
var unityPath = UnityPath.FromUnityPath(assetPath);
unityPath.ImportAsset();
var mesh = unityPath.LoadAsset<Mesh>();
return mesh;
}
/// <summary>
/// Write Mesh
/// </summary>
@ -248,16 +258,14 @@ namespace UniGLTF.MeshUtility
if (result.Integrated != null)
{
var childAssetPath = $"{assetFolder}/{result.Integrated.IntegratedRenderer.gameObject.name}{ASSET_SUFFIX}";
Debug.LogFormat("CreateAsset: {0}", childAssetPath);
AssetDatabase.CreateAsset(result.Integrated.IntegratedRenderer.sharedMesh, childAssetPath);
result.Integrated.Reload(childAssetPath);
result.Integrated.IntegratedRenderer.sharedMesh = WriteAndReload(
result.Integrated.IntegratedRenderer.sharedMesh, childAssetPath);
}
if (result.IntegratedNoBlendShape != null)
{
var childAssetPath = $"{assetFolder}/{result.IntegratedNoBlendShape.IntegratedRenderer.gameObject.name}{ASSET_SUFFIX}";
Debug.LogFormat("CreateAsset: {0}", childAssetPath);
AssetDatabase.CreateAsset(result.Integrated.IntegratedRenderer.sharedMesh, childAssetPath);
result.IntegratedNoBlendShape.Reload(childAssetPath);
result.IntegratedNoBlendShape.IntegratedRenderer.sharedMesh = WriteAndReload(
result.IntegratedNoBlendShape.IntegratedRenderer.sharedMesh, childAssetPath);
}
}

View File

@ -30,15 +30,6 @@ namespace UniGLTF.MeshUtility
smr.bones = bones;
IntegratedRenderer = smr;
}
public void Reload(string assetPath)
{
var unityPath = UnityPath.FromUnityPath(assetPath);
unityPath.ImportAsset();
var mesh = unityPath.LoadAsset<Mesh>();
// replace reloaded
IntegratedRenderer.sharedMesh = mesh;
}
}
public class MeshIntegrationResult

View File

@ -1,9 +1,11 @@
using UniGLTF;
using UnityEditor;
using UnityEngine;
using UniVRM10;
using UniVRM10.VRM10Viewer;
using VRMShaders;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class SimpleVrma : MonoBehaviour
{
@ -15,6 +17,7 @@ public class SimpleVrma : MonoBehaviour
void OnGUI()
{
#if UNITY_EDITOR
if (GUILayout.Button("open vrm"))
{
var path = EditorUtility.OpenFilePanel("open vrm", "", "vrm");
@ -28,6 +31,7 @@ public class SimpleVrma : MonoBehaviour
Debug.Log(path);
LoadVrma(path);
}
#endif
m_boxman = GUILayout.Toggle(m_boxman, "BoxMan");
if (Vrma != null)

View File

@ -1,9 +1,11 @@
using UniGLTF;
using UnityEditor;
using UnityEngine;
using UniVRM10;
using UniVRM10.VRM10Viewer;
using VRMShaders;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class SimpleVrma : MonoBehaviour
{
@ -15,6 +17,7 @@ public class SimpleVrma : MonoBehaviour
void OnGUI()
{
#if UNITY_EDITOR
if (GUILayout.Button("open vrm"))
{
var path = EditorUtility.OpenFilePanel("open vrm", "", "vrm");
@ -28,6 +31,7 @@ public class SimpleVrma : MonoBehaviour
Debug.Log(path);
LoadVrma(path);
}
#endif
m_boxman = GUILayout.Toggle(m_boxman, "BoxMan");
if (Vrma != null)

View File

@ -3,7 +3,7 @@
--- !u!129 &1
PlayerSettings:
m_ObjectHideFlags: 0
serializedVersion: 23
serializedVersion: 24
productGUID: d86624fc877a00d40a0d639083a0270e
AndroidProfiler: 0
AndroidFilterTouchesWhenObscured: 0
@ -177,10 +177,10 @@ PlayerSettings:
StripUnusedMeshComponents: 0
VertexChannelCompressionMask: 214
iPhoneSdkVersion: 988
iOSTargetOSVersionString: 11.0
iOSTargetOSVersionString: 12.0
tvOSSdkVersion: 0
tvOSRequireExtendedGameController: 0
tvOSTargetOSVersionString: 11.0
tvOSTargetOSVersionString: 12.0
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIRequiresFullScreen: 1
@ -434,7 +434,6 @@ PlayerSettings:
switchReleaseVersion: 0
switchDisplayVersion: 1.0.0
switchStartupUserAccount: 0
switchTouchScreenUsage: 0
switchSupportedLanguagesMask: 0
switchLogoType: 0
switchApplicationErrorCodeCategory:
@ -476,6 +475,7 @@ PlayerSettings:
switchNativeFsCacheSize: 32
switchIsHoldTypeHorizontal: 0
switchSupportedNpadCount: 8
switchEnableTouchScreen: 1
switchSocketConfigEnabled: 0
switchTcpInitialSendBufferSize: 32
switchTcpInitialReceiveBufferSize: 64
@ -600,7 +600,7 @@ PlayerSettings:
PS4: UNITY_POST_PROCESSING_STACK_V2
PS5: UNITY_POST_PROCESSING_STACK_V2
Stadia: UNITY_POST_PROCESSING_STACK_V2
Standalone: VRM_DEVELOP;UNITY_POST_PROCESSING_STACK_V2;ENABLE_UNITY_COLLECTIONS_CHECKS
Standalone: VRM_DEVELOP;UNITY_POST_PROCESSING_STACK_V2
WebGL: UNITY_POST_PROCESSING_STACK_V2
Windows Store Apps: UNITY_POST_PROCESSING_STACK_V2
XboxOne: UNITY_POST_PROCESSING_STACK_V2
@ -609,7 +609,20 @@ PlayerSettings:
platformArchitecture: {}
scriptingBackend: {}
il2cppCompilerConfiguration: {}
managedStrippingLevel: {}
managedStrippingLevel:
EmbeddedLinux: 1
GameCoreScarlett: 1
GameCoreXboxOne: 1
Lumin: 1
Nintendo Switch: 1
PS4: 1
PS5: 1
Stadia: 1
WebGL: 1
Windows Store Apps: 1
XboxOne: 1
iPhone: 1
tvOS: 1
incrementalIl2cppBuild: {}
suppressCommonWarnings: 1
allowUnsafeCode: 0