Skip to content

Commit

Permalink
Add version defines;
Browse files Browse the repository at this point in the history
Update changelog
  • Loading branch information
mtschoen-unity committed Sep 22, 2020
1 parent 41efe2b commit f467e0c
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 20 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.4.12-preview] - 2020-09-22
- Update List View Framework with multi-select changes
### Added
- Version defines and package dependencies for built-in modules

### Updated
- List View Framework dependency version

### Removed
- Dependency on Timeline

## [0.4.11-preview] - 2020-09-02
- Update List View Framework dependency version
Expand Down
2 changes: 2 additions & 0 deletions Interfaces/Providers/IProvidesWeb.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if INCLUDE_UNITY_WEB_REQUEST
using System;
using Unity.XRTools.ModuleLoader;
using UnityEngine.Networking;
Expand Down Expand Up @@ -33,3 +34,4 @@ public interface IProvidesWeb : IFunctionalityProvider
void Download(string url, string destination, Action completed);
}
}
#endif
2 changes: 2 additions & 0 deletions Interfaces/Subscribers/IUsesWeb.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if INCLUDE_UNITY_WEB_REQUEST
using System;
using Unity.XRTools.ModuleLoader;
using UnityEngine.Networking;
Expand Down Expand Up @@ -58,3 +59,4 @@ public static void Download(this IUsesWeb user, string url, string destination,
}
}
}
#endif
21 changes: 19 additions & 2 deletions Interfaces/Unity.Labs.EditorXR.Interfaces.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,22 @@
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}
"defineConstraints": [],
"versionDefines": [
{
"name": "com.unity.modules.unitywebrequest",
"expression": "1.0.0",
"define": "INCLUDE_UNITY_WEB_REQUEST"
},
{
"name": "com.unity.modules.video",
"expression": "1.0.0",
"define": "INCLUDE_VIDEO_MODULE"
},
{
"name": "com.unity.modules.audio",
"expression": "1.0.0",
"define": "INCLUDE_AUDIO_MODULE"
}
]
}
2 changes: 2 additions & 0 deletions Runtime/Scripts/Modules/WebModule.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if INCLUDE_UNITY_WEB_REQUEST
using System;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -199,3 +200,4 @@ public void ConnectSubscriber(object obj)
public void UnloadProvider() { }
}
}
#endif
34 changes: 29 additions & 5 deletions Runtime/Scripts/Utilities/AssetDropUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ static class AssetDropUtils
public static readonly Dictionary<string, List<Type>> AssignmentDependencies
= new Dictionary<string, List<Type>>
{
{ "AnimationClip", new List<Type> { typeof(Animation) } },
#if INCLUDE_AUDIO_MODULE
{ "AudioClip", new List<Type> { typeof(AudioSource) } },
#endif

#if INCLUDE_VIDEO_MODULE
{ "VideoClip", new List<Type> { typeof(VideoPlayer) } },
#endif

{ "AnimationClip", new List<Type> { typeof(Animation) } },
{ "Material", new List<Type> { typeof(Renderer) } },
{ "Shader", new List<Type> { typeof(Material) } },
{ "PhysicMaterial", new List<Type> {typeof(Collider) } }
Expand All @@ -29,15 +35,29 @@ public static readonly Dictionary<string, List<Type>> AssignmentDependencies
// dependency types to ignore when previewing asset assignment validity
public static List<Type> AutoFillTypes = new List<Type>
{
typeof(Animation), typeof(AudioSource), typeof(VideoPlayer)
#if INCLUDE_AUDIO_MODULE
typeof(AudioSource),
#endif

#if INCLUDE_VIDEO_MODULE
typeof(VideoPlayer),
#endif

typeof(Animation)
};

const string k_AssignAudioClipUndo = "Assign Audio Clip";
const string k_AssignAnimationClipUndo = "Assign Animation Clip";
const string k_AssignVideoClipUndo = "Assign Video Clip";
const string k_AssignFontUndo = "Assign Font";
const string k_AssignMaterialUndo = "Assign Material";
const string k_AssignPhysicMaterialUndo = "Assign Physic Material";
const string k_AssignAnimationClipUndo = "Assign Animation Clip";

#if INCLUDE_AUDIO_MODULE
const string k_AssignAudioClipUndo = "Assign Audio Clip";
#endif

#if INCLUDE_VIDEO_MODULE
const string k_AssignVideoClipUndo = "Assign Video Clip";
#endif

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

#if INCLUDE_AUDIO_MODULE
internal static AudioSource AttachAudioClip(GameObject go, AssetData data)
{
var source = ComponentUtils.GetOrAddIf<AudioSource>(go, s_CreatePlayerForClips);
Expand All @@ -87,7 +108,9 @@ internal static void AudioClipAction(GameObject go, AssetData data)
{
AttachAudioClip(go, data);
}
#endif

#if INCLUDE_VIDEO_MODULE
internal static VideoPlayer AttachVideoClip(GameObject go, AssetData data)
{
var player = ComponentUtils.GetOrAddIf<VideoPlayer>(go, s_CreatePlayerForClips);
Expand All @@ -106,6 +129,7 @@ internal static void VideoClipAction(GameObject go, AssetData data)
{
AttachVideoClip(go, data);
}
#endif

internal static GameObject AttachScript(GameObject go, AssetData data)
{
Expand Down
20 changes: 18 additions & 2 deletions Runtime/Unity.Labs.EditorXR.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,29 @@
"Unity.XRTools.SpatialHash.Public",
"Unity.XRTools.SpatialHash"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": []
"versionDefines": [
{
"name": "com.unity.modules.unitywebrequest",
"expression": "1.0.0",
"define": "INCLUDE_UNITY_WEB_REQUEST"
},
{
"name": "com.unity.modules.video",
"expression": "1.0.0",
"define": "INCLUDE_VIDEO_MODULE"
},
{
"name": "com.unity.modules.audio",
"expression": "1.0.0",
"define": "INCLUDE_AUDIO_MODULE"
}
],
"noEngineReferences": false
}
2 changes: 1 addition & 1 deletion Runtime/Workspaces/PolyWorkspace/PolyWorkspace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace Unity.EditorXR.Workspaces
{
#if INCLUDE_POLY_TOOLKIT
#if INCLUDE_POLY_TOOLKIT && INCLUDE_UNITY_WEB_REQUEST
[MainMenuItem("Poly", "Workspaces", "Import models from Google Poly")]
[SpatialMenuItem("Poly", "Workspaces", "Import models from Google Poly")]
sealed class PolyWorkspace : Workspace, ISerializeWorkspace
Expand Down
12 changes: 9 additions & 3 deletions Runtime/Workspaces/PolyWorkspace/Scripts/PolyGridAsset.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
using System;
using Unity.EditorXR.Interfaces;
using UnityEngine;
using Unity.ListViewFramework;

#if INCLUDE_UNITY_WEB_REQUEST
using Unity.EditorXR.Interfaces;
using Unity.XRTools.ModuleLoader;
#endif

#if INCLUDE_POLY_TOOLKIT
using PolyToolkit;
using UnityEngine.Networking;
#endif

namespace Unity.EditorXR.Workspaces
{
class PolyGridAsset : IListViewItemData<string>, IUsesWeb
class PolyGridAsset : IListViewItemData<string>
#if INCLUDE_UNITY_WEB_REQUEST
, IUsesWeb
#endif
{
const int k_MaxPreviewComplexity = 2500;
static readonly string k_TemplateName = "PolyGridItem";
Expand Down Expand Up @@ -41,7 +47,7 @@ class PolyGridAsset : IListViewItemData<string>, IUsesWeb
public bool initialized { get { return m_Initialized; } }
public long complexity { get { return m_Complexity; } }

#if !FI_AUTOFILL
#if INCLUDE_UNITY_WEB_REQUEST
IProvidesWeb IFunctionalitySubscriber<IProvidesWeb>.provider { get; set; }
#endif

Expand Down
10 changes: 10 additions & 0 deletions Runtime/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -599,15 +599,25 @@ void HandleAssetDropByType(Transform rayOrigin, AssetGridItem gridItem)
case AssetData.ModelTypeString:
PlaceModelOrPrefab(gridItem.transform, data);
break;

#if INCLUDE_ANIMATION_MODULE
case "AnimationClip":
SelectAndPlace(rayOrigin, data, AssetDropUtils.AssignAnimationClipAction);
break;
#endif

#if INCLUDE_AUDIO_MODULE
case "AudioClip":
SelectAndPlace(rayOrigin, data, AssetDropUtils.AudioClipAction);
break;
#endif

#if INCLUDE_VIDEO_MODULE
case "VideoClip":
SelectAndPlace(rayOrigin, data, AssetDropUtils.VideoClipAction);
break;
#endif

case "Font":
SelectAndPlace(rayOrigin, data, AssetDropUtils.AssignFontAction);
break;
Expand Down
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
"unityRelease": "14f1",
"description": "Author XR in XR\nEditorXR provides a basic set of authoring tools and a framework for using and developing spatial authoring environments. This package adds the VR View to the Unity Editor, allowing users to take advantage of VR devices like Oculus Rift and HTC Vive in edit mode and work directly on their project and scenes in VR.\nIt is also possible to build EditorXR and its tools and workspaces into Player builds for use on devices like Oculus Quest or to incoroprate authoring components into end-user experiences.",
"dependencies": {
"com.unity.xrtools.utils": "1.1.1",
"com.unity.xrtools.module-loader": "1.1.1",
"com.unity.list-view-framework": "1.1.6-preview",
"com.unity.xrtools.spatial-hash": "0.1.3-preview",
"com.unity.list-view-framework": "1.1.7-preview",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.textmeshpro": "2.0.1",
"com.unity.xr.legacyinputhelpers": "2.0.6",
"com.unity.xr-line-renderer": "0.1.2-preview",
"com.unity.timeline": "1.0.0",
"com.unity.textmeshpro": "2.0.1"
"com.unity.xrtools.module-loader": "1.1.1",
"com.unity.xrtools.spatial-hash": "0.1.3-preview",
"com.unity.xrtools.utils": "1.1.1"
}
}

0 comments on commit f467e0c

Please sign in to comment.