mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-06-15 12:30:40 -05:00
experimental zip archive importer
This commit is contained in:
parent
fa9969fe6c
commit
d90179a720
|
|
@ -0,0 +1,25 @@
|
|||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
#if UNITY_2020_2_OR_NEWER
|
||||
using UnityEditor.AssetImporters;
|
||||
#else
|
||||
using UnityEditor.Experimental.AssetImporters;
|
||||
#endif
|
||||
|
||||
|
||||
namespace UniGLTF
|
||||
{
|
||||
#if UNIGLTF_ENABLE_ZIPARCHVIE_IMPORTER
|
||||
[ScriptedImporter(1, "zip")]
|
||||
#endif
|
||||
public class ZipArchivedGltfScriptedImporter : ScriptedImporter
|
||||
{
|
||||
[SerializeField]
|
||||
public ScriptedImporterAxes m_reverseAxis = default;
|
||||
|
||||
public override void OnImportAsset(AssetImportContext ctx)
|
||||
{
|
||||
ScriptedImporterImpl.Import(this, ctx, m_reverseAxis.ToAxes());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8e13aa2d6ae3bf843aaca5298bb4d26c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -11,6 +11,8 @@ namespace UniGLTF
|
|||
{
|
||||
public static class UniGLTFPreference
|
||||
{
|
||||
public const string UNIGLTF_ENABLE_ZIPARCHVIE_IMPORTER = "UNIGLTF_ENABLE_ZIPARCHVIE_IMPORTER";
|
||||
|
||||
static IEnumerable<string> GetReimportPaths()
|
||||
{
|
||||
String[] guids = AssetDatabase.FindAssets("t:GameObject", null);
|
||||
|
|
@ -68,6 +70,10 @@ namespace UniGLTF
|
|||
AssetDatabase.ImportAsset(path, default);
|
||||
}
|
||||
}
|
||||
|
||||
// zip
|
||||
UniGLTF.UniGLTFPreference.ToggleSymbol("Enable zip importer that contains gltf", UNIGLTF_ENABLE_ZIPARCHVIE_IMPORTER);
|
||||
EditorGUILayout.HelpBox("This is `.zip` extension importer", MessageType.Warning);
|
||||
}
|
||||
|
||||
const string AXIS_KEY = "UNIGLTF_IO_AXIS";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user