Skip to content

Commit

Permalink
Merge pull request chgatla-microsoft#12 from chgatla-microsoft/unity2019
Browse files Browse the repository at this point in the history
Port to Unity 2019 with latest XRSDK and MRTK
  • Loading branch information
chgatla-microsoft authored Jun 18, 2020
2 parents 009fac0 + b6d663a commit 1b32671
Show file tree
Hide file tree
Showing 3,895 changed files with 654,057 additions and 749 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/AssemblyInfo.cs
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")]
11 changes: 11 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/AssemblyInfo.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/Attributes.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/Attributes/DocLinkAttribute.cs
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; }
}
}
11 changes: 11 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/Attributes/DocLinkAttribute.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/Attributes/EnumFlagsAttribute.cs
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.

35 changes: 35 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/Attributes/ExperimentalAttribute.cs
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.

41 changes: 41 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/Attributes/ExtendsAttribute.cs
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;
}
}
}
11 changes: 11 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/Attributes/ExtendsAttribute.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/Attributes/HelpAttribute.cs
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;
}
}
}
11 changes: 11 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/Attributes/HelpAttribute.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions SampleQRCodes/Assets/MRTK/Core/Attributes/ImplementsAttribute.cs
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.

Loading

0 comments on commit 1b32671

Please sign in to comment.