From 6e0d3e20f1bf1745befc79489432156704c47848 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 12 Dec 2023 16:30:28 +0900 Subject: [PATCH 1/4] remove ENABLE_UNITY_COLLECTIONS_CHECKS symbol. --- ProjectSettings/ProjectSettings.asset | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 897f3bd11..70206b19a 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -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 From 9c22dc58b54f8dc7788eabb75961a384b06fba87 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 12 Dec 2023 16:31:04 +0900 Subject: [PATCH 2/4] move asset reload to editor --- .../Editor/MeshUtility/MeshUtilityDialog.cs | 20 +++++++++++++------ .../MeshUtility/MeshIntegrationResult.cs | 9 --------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Assets/UniGLTF/Editor/MeshUtility/MeshUtilityDialog.cs b/Assets/UniGLTF/Editor/MeshUtility/MeshUtilityDialog.cs index 3ef6ff0de..c2a923b83 100644 --- a/Assets/UniGLTF/Editor/MeshUtility/MeshUtilityDialog.cs +++ b/Assets/UniGLTF/Editor/MeshUtility/MeshUtilityDialog.cs @@ -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(); + return mesh; + } + /// /// Write Mesh /// @@ -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); } } diff --git a/Assets/UniGLTF/Runtime/MeshUtility/MeshIntegrationResult.cs b/Assets/UniGLTF/Runtime/MeshUtility/MeshIntegrationResult.cs index a87c8ad31..30a657006 100644 --- a/Assets/UniGLTF/Runtime/MeshUtility/MeshIntegrationResult.cs +++ b/Assets/UniGLTF/Runtime/MeshUtility/MeshIntegrationResult.cs @@ -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(); - // replace reloaded - IntegratedRenderer.sharedMesh = mesh; - } } public class MeshIntegrationResult From 5a4caa003730c8de140a54c8fc45e3727e2501bb Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 12 Dec 2023 16:31:39 +0900 Subject: [PATCH 3/4] sample workaround. UNITY_EDITOR --- Assets/VRM10_Samples/SimpleVrma/SimpleVrma.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/VRM10_Samples/SimpleVrma/SimpleVrma.cs b/Assets/VRM10_Samples/SimpleVrma/SimpleVrma.cs index 40f12753a..dc125a9b8 100644 --- a/Assets/VRM10_Samples/SimpleVrma/SimpleVrma.cs +++ b/Assets/VRM10_Samples/SimpleVrma/SimpleVrma.cs @@ -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) From 8424f4bd7a8b8b39d2b31894501e8d04064db795 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 12 Dec 2023 16:34:26 +0900 Subject: [PATCH 4/4] copy sample --- Assets/VRM10/Samples~/SimpleVrma/SimpleVrma.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/VRM10/Samples~/SimpleVrma/SimpleVrma.cs b/Assets/VRM10/Samples~/SimpleVrma/SimpleVrma.cs index 40f12753a..dc125a9b8 100644 --- a/Assets/VRM10/Samples~/SimpleVrma/SimpleVrma.cs +++ b/Assets/VRM10/Samples~/SimpleVrma/SimpleVrma.cs @@ -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)