File tree Expand file tree Collapse file tree 4 files changed +25
-4
lines changed
Assets/MRTK/Core/Utilities
Gltf/Serialization/Importers Expand file tree Collapse file tree 4 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public static class ScriptUtilities
20
20
/// <param name="symbols">Array of symbols to define.</param>
21
21
public static void AppendScriptingDefinitions (
22
22
BuildTargetGroup targetGroup ,
23
- string [ ] symbols )
23
+ params string [ ] symbols )
24
24
{
25
25
if ( symbols == null || symbols . Length == 0 ) { return ; }
26
26
@@ -38,7 +38,7 @@ public static void AppendScriptingDefinitions(
38
38
/// <param name="symbols">Array of symbols to remove.</param>
39
39
public static void RemoveScriptingDefinitions (
40
40
BuildTargetGroup targetGroup ,
41
- string [ ] symbols )
41
+ params string [ ] symbols )
42
42
{
43
43
if ( symbols == null || symbols . Length == 0 ) { return ; }
44
44
Original file line number Diff line number Diff line change 9
9
10
10
namespace Microsoft . MixedReality . Toolkit . Utilities . Gltf . Serialization . Editor
11
11
{
12
+ #if ! MRTK_GLTF_IMPORTER_OFF
12
13
[ ScriptedImporter ( 1 , "glb" ) ]
14
+ #endif // !MRTK_GLTF_IMPORTER_OFF
13
15
public class GlbAssetImporter : ScriptedImporter
14
16
{
15
17
public override void OnImportAsset ( AssetImportContext context )
16
18
{
17
19
GltfEditorImporter . OnImportGltfAsset ( context ) ;
18
20
}
19
21
}
20
- }
22
+ }
Original file line number Diff line number Diff line change 9
9
10
10
namespace Microsoft . MixedReality . Toolkit . Utilities . Gltf . Serialization . Editor
11
11
{
12
+ #if ! MRTK_GLTF_IMPORTER_OFF
12
13
[ ScriptedImporter ( 1 , "gltf" ) ]
14
+ #endif // !MRTK_GLTF_IMPORTER_OFF
13
15
public class GltfAssetImporter : ScriptedImporter
14
16
{
15
17
public override void OnImportAsset ( AssetImportContext context )
16
18
{
17
19
GltfEditorImporter . OnImportGltfAsset ( context ) ;
18
20
}
19
21
}
20
- }
22
+ }
Original file line number Diff line number Diff line change 1
1
// Copyright (c) Microsoft Corporation.
2
2
// Licensed under the MIT License.
3
3
4
+ using Microsoft . MixedReality . Toolkit . Utilities . Editor ;
4
5
using Microsoft . MixedReality . Toolkit . Utilities . Gltf . Schema ;
5
6
using System . IO ;
6
7
using UnityEditor ;
@@ -16,6 +17,22 @@ namespace Microsoft.MixedReality.Toolkit.Utilities.Gltf.Serialization.Editor
16
17
{
17
18
public static class GltfEditorImporter
18
19
{
20
+ #if MRTK_GLTF_IMPORTER_OFF
21
+ [ MenuItem ( "Mixed Reality/Toolkit/Utilities/Enable MRTK glTF asset importer" ) ]
22
+ #else
23
+ [ MenuItem ( "Mixed Reality/Toolkit/Utilities/Disable MRTK glTF asset importer" ) ]
24
+ #endif
25
+ private static void ReconcileGltfImporterDefine ( )
26
+ {
27
+ BuildTargetGroup group = BuildPipeline . GetBuildTargetGroup ( EditorUserBuildSettings . activeBuildTarget ) ;
28
+
29
+ #if MRTK_GLTF_IMPORTER_OFF
30
+ ScriptUtilities . RemoveScriptingDefinitions ( group , "MRTK_GLTF_IMPORTER_OFF" ) ;
31
+ #else
32
+ ScriptUtilities . AppendScriptingDefinitions ( group , "MRTK_GLTF_IMPORTER_OFF" ) ;
33
+ #endif
34
+ }
35
+
19
36
public static async void OnImportGltfAsset ( AssetImportContext context )
20
37
{
21
38
var importedObject = await GltfUtility . ImportGltfObjectFromPathAsync ( context . assetPath ) ;
You can’t perform that action at this time.
0 commit comments