Skip to content

Commit f467e0c

Browse files
Add version defines;
Update changelog
1 parent 41efe2b commit f467e0c

File tree

11 files changed

+110
-20
lines changed

11 files changed

+110
-20
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [0.4.12-preview] - 2020-09-22
8-
- Update List View Framework with multi-select changes
8+
### Added
9+
- Version defines and package dependencies for built-in modules
10+
11+
### Updated
12+
- List View Framework dependency version
13+
14+
### Removed
15+
- Dependency on Timeline
916

1017
## [0.4.11-preview] - 2020-09-02
1118
- Update List View Framework dependency version

Interfaces/Providers/IProvidesWeb.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if INCLUDE_UNITY_WEB_REQUEST
12
using System;
23
using Unity.XRTools.ModuleLoader;
34
using UnityEngine.Networking;
@@ -33,3 +34,4 @@ public interface IProvidesWeb : IFunctionalityProvider
3334
void Download(string url, string destination, Action completed);
3435
}
3536
}
37+
#endif

Interfaces/Subscribers/IUsesWeb.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if INCLUDE_UNITY_WEB_REQUEST
12
using System;
23
using Unity.XRTools.ModuleLoader;
34
using UnityEngine.Networking;
@@ -58,3 +59,4 @@ public static void Download(this IUsesWeb user, string url, string destination,
5859
}
5960
}
6061
}
62+
#endif

Interfaces/Unity.Labs.EditorXR.Interfaces.asmdef

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,22 @@
1111
"overrideReferences": false,
1212
"precompiledReferences": [],
1313
"autoReferenced": true,
14-
"defineConstraints": []
15-
}
14+
"defineConstraints": [],
15+
"versionDefines": [
16+
{
17+
"name": "com.unity.modules.unitywebrequest",
18+
"expression": "1.0.0",
19+
"define": "INCLUDE_UNITY_WEB_REQUEST"
20+
},
21+
{
22+
"name": "com.unity.modules.video",
23+
"expression": "1.0.0",
24+
"define": "INCLUDE_VIDEO_MODULE"
25+
},
26+
{
27+
"name": "com.unity.modules.audio",
28+
"expression": "1.0.0",
29+
"define": "INCLUDE_AUDIO_MODULE"
30+
}
31+
]
32+
}

Runtime/Scripts/Modules/WebModule.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if INCLUDE_UNITY_WEB_REQUEST
12
using System;
23
using System.Collections.Generic;
34
using System.IO;
@@ -199,3 +200,4 @@ public void ConnectSubscriber(object obj)
199200
public void UnloadProvider() { }
200201
}
201202
}
203+
#endif

Runtime/Scripts/Utilities/AssetDropUtils.cs

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ static class AssetDropUtils
1818
public static readonly Dictionary<string, List<Type>> AssignmentDependencies
1919
= new Dictionary<string, List<Type>>
2020
{
21-
{ "AnimationClip", new List<Type> { typeof(Animation) } },
21+
#if INCLUDE_AUDIO_MODULE
2222
{ "AudioClip", new List<Type> { typeof(AudioSource) } },
23+
#endif
24+
25+
#if INCLUDE_VIDEO_MODULE
2326
{ "VideoClip", new List<Type> { typeof(VideoPlayer) } },
27+
#endif
28+
29+
{ "AnimationClip", new List<Type> { typeof(Animation) } },
2430
{ "Material", new List<Type> { typeof(Renderer) } },
2531
{ "Shader", new List<Type> { typeof(Material) } },
2632
{ "PhysicMaterial", new List<Type> {typeof(Collider) } }
@@ -29,15 +35,29 @@ public static readonly Dictionary<string, List<Type>> AssignmentDependencies
2935
// dependency types to ignore when previewing asset assignment validity
3036
public static List<Type> AutoFillTypes = new List<Type>
3137
{
32-
typeof(Animation), typeof(AudioSource), typeof(VideoPlayer)
38+
#if INCLUDE_AUDIO_MODULE
39+
typeof(AudioSource),
40+
#endif
41+
42+
#if INCLUDE_VIDEO_MODULE
43+
typeof(VideoPlayer),
44+
#endif
45+
46+
typeof(Animation)
3347
};
3448

35-
const string k_AssignAudioClipUndo = "Assign Audio Clip";
36-
const string k_AssignAnimationClipUndo = "Assign Animation Clip";
37-
const string k_AssignVideoClipUndo = "Assign Video Clip";
3849
const string k_AssignFontUndo = "Assign Font";
3950
const string k_AssignMaterialUndo = "Assign Material";
4051
const string k_AssignPhysicMaterialUndo = "Assign Physic Material";
52+
const string k_AssignAnimationClipUndo = "Assign Animation Clip";
53+
54+
#if INCLUDE_AUDIO_MODULE
55+
const string k_AssignAudioClipUndo = "Assign Audio Clip";
56+
#endif
57+
58+
#if INCLUDE_VIDEO_MODULE
59+
const string k_AssignVideoClipUndo = "Assign Video Clip";
60+
#endif
4161

4262
// TODO - make all these booleans options in the settings menu
4363
static bool s_CreatePlayerForClips = true;
@@ -69,6 +89,7 @@ internal static void AssignAnimationClipAction(GameObject go, AssetData data)
6989
AssignAnimationClip(go, data);
7090
}
7191

92+
#if INCLUDE_AUDIO_MODULE
7293
internal static AudioSource AttachAudioClip(GameObject go, AssetData data)
7394
{
7495
var source = ComponentUtils.GetOrAddIf<AudioSource>(go, s_CreatePlayerForClips);
@@ -87,7 +108,9 @@ internal static void AudioClipAction(GameObject go, AssetData data)
87108
{
88109
AttachAudioClip(go, data);
89110
}
111+
#endif
90112

113+
#if INCLUDE_VIDEO_MODULE
91114
internal static VideoPlayer AttachVideoClip(GameObject go, AssetData data)
92115
{
93116
var player = ComponentUtils.GetOrAddIf<VideoPlayer>(go, s_CreatePlayerForClips);
@@ -106,6 +129,7 @@ internal static void VideoClipAction(GameObject go, AssetData data)
106129
{
107130
AttachVideoClip(go, data);
108131
}
132+
#endif
109133

110134
internal static GameObject AttachScript(GameObject go, AssetData data)
111135
{

Runtime/Unity.Labs.EditorXR.asmdef

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,29 @@
1515
"Unity.XRTools.SpatialHash.Public",
1616
"Unity.XRTools.SpatialHash"
1717
],
18-
"optionalUnityReferences": [],
1918
"includePlatforms": [],
2019
"excludePlatforms": [],
2120
"allowUnsafeCode": false,
2221
"overrideReferences": false,
2322
"precompiledReferences": [],
2423
"autoReferenced": true,
2524
"defineConstraints": [],
26-
"versionDefines": []
25+
"versionDefines": [
26+
{
27+
"name": "com.unity.modules.unitywebrequest",
28+
"expression": "1.0.0",
29+
"define": "INCLUDE_UNITY_WEB_REQUEST"
30+
},
31+
{
32+
"name": "com.unity.modules.video",
33+
"expression": "1.0.0",
34+
"define": "INCLUDE_VIDEO_MODULE"
35+
},
36+
{
37+
"name": "com.unity.modules.audio",
38+
"expression": "1.0.0",
39+
"define": "INCLUDE_AUDIO_MODULE"
40+
}
41+
],
42+
"noEngineReferences": false
2743
}

Runtime/Workspaces/PolyWorkspace/PolyWorkspace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace Unity.EditorXR.Workspaces
2121
{
22-
#if INCLUDE_POLY_TOOLKIT
22+
#if INCLUDE_POLY_TOOLKIT && INCLUDE_UNITY_WEB_REQUEST
2323
[MainMenuItem("Poly", "Workspaces", "Import models from Google Poly")]
2424
[SpatialMenuItem("Poly", "Workspaces", "Import models from Google Poly")]
2525
sealed class PolyWorkspace : Workspace, ISerializeWorkspace

Runtime/Workspaces/PolyWorkspace/Scripts/PolyGridAsset.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
using System;
2-
using Unity.EditorXR.Interfaces;
32
using UnityEngine;
43
using Unity.ListViewFramework;
54

5+
#if INCLUDE_UNITY_WEB_REQUEST
6+
using Unity.EditorXR.Interfaces;
67
using Unity.XRTools.ModuleLoader;
8+
#endif
9+
710
#if INCLUDE_POLY_TOOLKIT
811
using PolyToolkit;
912
using UnityEngine.Networking;
1013
#endif
1114

1215
namespace Unity.EditorXR.Workspaces
1316
{
14-
class PolyGridAsset : IListViewItemData<string>, IUsesWeb
17+
class PolyGridAsset : IListViewItemData<string>
18+
#if INCLUDE_UNITY_WEB_REQUEST
19+
, IUsesWeb
20+
#endif
1521
{
1622
const int k_MaxPreviewComplexity = 2500;
1723
static readonly string k_TemplateName = "PolyGridItem";
@@ -41,7 +47,7 @@ class PolyGridAsset : IListViewItemData<string>, IUsesWeb
4147
public bool initialized { get { return m_Initialized; } }
4248
public long complexity { get { return m_Complexity; } }
4349

44-
#if !FI_AUTOFILL
50+
#if INCLUDE_UNITY_WEB_REQUEST
4551
IProvidesWeb IFunctionalitySubscriber<IProvidesWeb>.provider { get; set; }
4652
#endif
4753

Runtime/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,15 +599,25 @@ void HandleAssetDropByType(Transform rayOrigin, AssetGridItem gridItem)
599599
case AssetData.ModelTypeString:
600600
PlaceModelOrPrefab(gridItem.transform, data);
601601
break;
602+
603+
#if INCLUDE_ANIMATION_MODULE
602604
case "AnimationClip":
603605
SelectAndPlace(rayOrigin, data, AssetDropUtils.AssignAnimationClipAction);
604606
break;
607+
#endif
608+
609+
#if INCLUDE_AUDIO_MODULE
605610
case "AudioClip":
606611
SelectAndPlace(rayOrigin, data, AssetDropUtils.AudioClipAction);
607612
break;
613+
#endif
614+
615+
#if INCLUDE_VIDEO_MODULE
608616
case "VideoClip":
609617
SelectAndPlace(rayOrigin, data, AssetDropUtils.VideoClipAction);
610618
break;
619+
#endif
620+
611621
case "Font":
612622
SelectAndPlace(rayOrigin, data, AssetDropUtils.AssignFontAction);
613623
break;

0 commit comments

Comments
 (0)