Added Unity project files

This commit is contained in:
2026-06-07 16:58:24 +01:00
parent 3cc05d260b
commit 23bbcab156
3942 changed files with 453676 additions and 0 deletions

View File

@ -0,0 +1,39 @@
using System.Reflection;
using UnityEditor;
using UnityEngine.Assertions;
namespace VRWorldToolkit.Editor
{
/// <summary>
/// Utility for setting and getting internal model importer values
/// </summary>
public static class ModelImporterUtil
{
private static readonly System.Type systemType;
private static PropertyInfo mProperty_LegacyBlendShapeNormals;
static ModelImporterUtil()
{
systemType = Assembly.Load("UnityEditor.dll").GetType("UnityEditor.ModelImporter");
Assert.IsNotNull(systemType);
}
public static bool GetLegacyBlendShapeNormals(ModelImporter importer)
{
if (mProperty_LegacyBlendShapeNormals == null)
mProperty_LegacyBlendShapeNormals = systemType.GetProperty("legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes", BindingFlags.NonPublic | BindingFlags.Instance);
Assert.IsNotNull(mProperty_LegacyBlendShapeNormals);
return (bool)mProperty_LegacyBlendShapeNormals.GetValue(importer);
}
public static void SetLegacyBlendShapeNormals(ModelImporter importer, bool value)
{
if (mProperty_LegacyBlendShapeNormals == null)
mProperty_LegacyBlendShapeNormals = systemType.GetProperty("legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes", BindingFlags.NonPublic | BindingFlags.Instance);
Assert.IsNotNull(mProperty_LegacyBlendShapeNormals);
mProperty_LegacyBlendShapeNormals.SetValue(importer, value, null);
}
}
}