-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
Port to Unity 2019 with latest XRSDK and MRTK
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System.Reflection; | ||
|
||
[assembly: AssemblyVersion("2.4.0.0")] | ||
[assembly: AssemblyFileVersion("2.4.0.0")] | ||
|
||
[assembly: AssemblyProduct("Microsoft® Mixed Reality Toolkit")] | ||
[assembly: AssemblyCopyright("Copyright © Microsoft Corporation")] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace Microsoft.MixedReality.Toolkit | ||
{ | ||
/// <summary> | ||
/// Defines a documentation link for a service. | ||
/// Used primarily by service inspector facades. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] | ||
[Obsolete("Use HelpURLAttribute from Unity instead")] | ||
public class DocLinkAttribute : Attribute | ||
{ | ||
public DocLinkAttribute(string url) { URL = url; } | ||
|
||
public string URL { get; private set; } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System; | ||
using UnityEngine; | ||
|
||
namespace Microsoft.MixedReality.Toolkit | ||
{ | ||
/// <summary> | ||
/// An attribute that allows a particular field to be rendered as multi-selectable | ||
/// set of flags. | ||
/// </summary> | ||
/// <remarks> | ||
/// From https://answers.unity.com/questions/486694/default-editor-enum-as-flags-.html | ||
/// </remarks> | ||
[AttributeUsage(AttributeTargets.Field)] | ||
public sealed class EnumFlagsAttribute : PropertyAttribute | ||
{ | ||
public EnumFlagsAttribute() { } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
using UnityEngine; | ||
using System; | ||
|
||
namespace Microsoft.MixedReality.Toolkit | ||
{ | ||
/// <summary> | ||
/// A PropertyAttribute for showing a warning box that the tagged implementation is experimental. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Field, Inherited = true)] | ||
public class ExperimentalAttribute : PropertyAttribute | ||
{ | ||
/// <summary> | ||
/// The text to display in the warning box. | ||
/// </summary> | ||
public string Text; | ||
|
||
private const string defaultText = "<b><color=yellow>This is an experimental feature.</color></b>\n" + | ||
"Parts of the MRTK appear to have a lot of value even if the details " + | ||
"haven’t fully been fleshed out. For these types of features, we want " + | ||
"the community to see them and get value out of them early. Because " + | ||
"they are early in the cycle, we label them as experimental to indicate " + | ||
"that they are still evolving, and subject to change over time."; | ||
|
||
/// <summary> | ||
/// Constructor. | ||
/// </summary> | ||
/// <param name="experimentalText">The experimental text to display in the warning box.</param> | ||
public ExperimentalAttribute(string experimentalText = defaultText) | ||
{ | ||
Text = experimentalText; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using Microsoft.MixedReality.Toolkit.Utilities; | ||
#if WINDOWS_UWP && !ENABLE_IL2CPP | ||
using Microsoft.MixedReality.Toolkit; | ||
#endif // WINDOWS_UWP && !ENABLE_IL2CPP | ||
using System; | ||
|
||
namespace Microsoft.MixedReality.Toolkit | ||
{ | ||
/// <summary> | ||
/// Constraint that allows selection of classes that extend a specific class when | ||
/// selecting a <see cref="Utilities.SystemType"/> with the Unity inspector. | ||
/// </summary> | ||
public sealed class ExtendsAttribute : SystemTypeAttribute | ||
{ | ||
/// <summary> | ||
/// Gets the type of class that selectable classes must derive from. | ||
/// </summary> | ||
public Type BaseType { get; private set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ExtendsAttribute"/> class. | ||
/// </summary> | ||
/// <param name="baseType">Type of class that selectable classes must derive from.</param> | ||
/// <param name="grouping">Gets or sets grouping of selectable classes. Defaults to <see cref="Utilities.TypeGrouping.ByNamespaceFlat"/> unless explicitly specified.</param> | ||
public ExtendsAttribute(Type baseType, TypeGrouping grouping) : base(baseType, grouping) | ||
{ | ||
BaseType = baseType; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override bool IsConstraintSatisfied(Type type) | ||
{ | ||
return base.IsConstraintSatisfied(type) && | ||
BaseType.IsAssignableFrom(type) && | ||
type != BaseType; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
using UnityEngine; | ||
using System; | ||
|
||
namespace Microsoft.MixedReality.Toolkit | ||
{ | ||
/// <summary> | ||
/// A PropertyAttribute for showing a collapsible Help section. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Field|AttributeTargets.Property, AllowMultiple = false)] | ||
public class HelpAttribute : PropertyAttribute | ||
{ | ||
/// <summary> | ||
/// The help text | ||
/// </summary> | ||
public string Text; | ||
|
||
/// <summary> | ||
/// The help header foldout text | ||
/// </summary> | ||
/// <remarks> | ||
/// If Collapsible is false, then this header text will not be shown. | ||
/// </remarks> | ||
public string Header; | ||
|
||
/// <summary> | ||
/// If true, this will be a collapsible help section. Defaults to true. | ||
/// </summary> | ||
public bool Collapsible; | ||
|
||
/// <summary> | ||
/// Constructor | ||
/// </summary> | ||
/// <param name="helpText">The help text to display</param> | ||
/// <param name="helpHeader">The help header foldout text</param> | ||
/// <param name="collapsible">If true, this help drawer will be collapsible</param> | ||
public HelpAttribute(string helpText, string helpHeader="Help", bool collapsible = true) | ||
{ | ||
Text = helpText; | ||
Header = helpHeader; | ||
Collapsible = collapsible; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using Microsoft.MixedReality.Toolkit.Utilities; | ||
#if WINDOWS_UWP && !ENABLE_IL2CPP | ||
using Microsoft.MixedReality.Toolkit; | ||
#endif // WINDOWS_UWP && !ENABLE_IL2CPP | ||
using System; | ||
|
||
namespace Microsoft.MixedReality.Toolkit | ||
{ | ||
/// <summary> | ||
/// Constraint that allows selection of classes that implement a specific interface | ||
/// when selecting a <see cref="Utilities.SystemType"/> with the Unity inspector. | ||
/// </summary> | ||
public sealed class ImplementsAttribute : SystemTypeAttribute | ||
{ | ||
/// <summary> | ||
/// Gets the type of interface that selectable classes must implement. | ||
/// </summary> | ||
public Type InterfaceType { get; private set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ImplementsAttribute"/> class. | ||
/// </summary> | ||
/// <param name="interfaceType">Type of interface that selectable classes must implement.</param> | ||
/// <param name="grouping">Gets or sets grouping of selectable classes. Defaults to <see cref="Utilities.TypeGrouping.ByNamespaceFlat"/> unless explicitly specified.</param> | ||
public ImplementsAttribute(Type interfaceType, TypeGrouping grouping) : base(interfaceType, grouping) | ||
{ | ||
InterfaceType = interfaceType; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override bool IsConstraintSatisfied(Type type) | ||
{ | ||
if (base.IsConstraintSatisfied(type)) | ||
{ | ||
var interfaces = type.GetInterfaces(); | ||
for (var i = 0; i < interfaces.Length; i++) | ||
{ | ||
if (interfaces[i] == InterfaceType) | ||
{ | ||
return true; | ||
} | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.