From 6d5ef8a73d7e7b548514c9283f72a3249839a979 Mon Sep 17 00:00:00 2001 From: Adam Mollis Date: Tue, 18 Jul 2023 10:08:06 -0700 Subject: [PATCH 01/10] Updating comments --- .../AccessibilitySubsystemDescriptor.cs | 2 +- .../Editor/Utilities/InspectorUIUtility.cs | 26 ++-- .../Hands/HandsSubsystemDescriptor.cs | 2 +- .../Subsystems/MRTKSubsystemDescriptor.cs | 2 +- .../KeywordRecognitionSubsystemDescriptor.cs | 2 +- .../Speech/TextToSpeechSubsystemDescriptor.cs | 2 +- .../Utilities/Extensions/BoundsExtensions.cs | 6 +- .../Extensions/GameObjectExtensions.cs | 4 +- .../Utilities/MathUtilities.cs | 4 +- .../DataConsumers/DataConsumerCollection.cs | 63 ++++---- .../DataConsumerCommandDispatcher.cs | 11 +- .../DataConsumers/DataConsumerGOBase.cs | 2 +- .../DataConsumers/DataConsumerThemableBase.cs | 67 ++++++--- .../DataConsumers/DataConsumerThemeHelper.cs | 32 +++- .../Runtime/Scripts/Helper/DataParser.cs | 9 +- .../Helper/DataSourceProviderSingleton.cs | 8 +- .../Scripts/Interfaces/IDataConsumer.cs | 26 +++- .../Interfaces/IDataConsumerThemable.cs | 34 +++-- .../Scripts/Interfaces/IDataKeyPathMapper.cs | 20 ++- .../Runtime/Scripts/Interfaces/IDataNode.cs | 33 ++--- .../Runtime/Scripts/Interfaces/IDataSource.cs | 101 +++++++------ .../Runtime/Utilities/InputTestUtilities.cs | 137 ++++++++++++------ .../Tests/Runtime/Utilities/TestController.cs | 1 + .../Tests/Runtime/Utilities/TestHand.cs | 7 +- .../Solvers/SolverHandler.cs | 2 +- 25 files changed, 377 insertions(+), 226 deletions(-) diff --git a/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystemDescriptor.cs b/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystemDescriptor.cs index a1cd0e9d6fd..faca3dee022 100644 --- a/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystemDescriptor.cs +++ b/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystemDescriptor.cs @@ -40,7 +40,7 @@ public struct AccessibilitySubsystemCinfo : /// Tests for equality. /// /// The other to compare against. - /// if every field in is equal to this , otherwise false. + /// if every field in is equal to this , otherwise . public bool Equals(AccessibilitySubsystemCinfo other) { return diff --git a/com.microsoft.mrtk.core/Editor/Utilities/InspectorUIUtility.cs b/com.microsoft.mrtk.core/Editor/Utilities/InspectorUIUtility.cs index 9f6e6e78641..cfd4799466c 100644 --- a/com.microsoft.mrtk.core/Editor/Utilities/InspectorUIUtility.cs +++ b/com.microsoft.mrtk.core/Editor/Utilities/InspectorUIUtility.cs @@ -171,7 +171,7 @@ public static bool RenderMixedRealityToolkitLogo() /// /// text to place in button /// layout options - /// true if button clicked, false if otherwise + /// if button clicked, if otherwise public static bool RenderIndentedButton(string buttonText, params GUILayoutOption[] options) { return RenderIndentedButton(() => { return GUILayout.Button(buttonText, options); }); @@ -183,7 +183,7 @@ public static bool RenderIndentedButton(string buttonText, params GUILayoutOptio /// What to draw in button /// Style configuration for button /// layout options - /// true if button clicked, false if otherwise + /// if button clicked, if otherwise. public static bool RenderIndentedButton(GUIContent content, GUIStyle style, params GUILayoutOption[] options) { return RenderIndentedButton(() => { return GUILayout.Button(content, style, options); }); @@ -193,7 +193,7 @@ public static bool RenderIndentedButton(GUIContent content, GUIStyle style, para /// Helper function to support primary overloaded version of this functionality /// /// The code to render button correctly based on parameter types passed - /// true if button clicked, false if otherwise + /// if button clicked, if otherwise. public static bool RenderIndentedButton(Func renderButton) { bool result = false; @@ -208,7 +208,7 @@ public static bool RenderIndentedButton(Func renderButton) /// Render documentation button routing to relevant URI /// /// documentation URL to open on button click - /// true if button clicked, false otherwise + /// if button clicked, otherwise. public static bool RenderDocumentationButton(string docURL, float width = DocLinkWidth) { if (!string.IsNullOrEmpty(docURL)) @@ -238,7 +238,7 @@ public static bool RenderDocumentationButton(string docURL, float width = DocLin /// Render a documentation header with button if Object contains HelpURLAttribute /// /// Type to test for HelpURLAttribute - /// true if object drawn and button clicked, false otherwise + /// if object drawn and button clicked, otherwise. public static bool RenderHelpURL(Type targetType) { bool result = false; @@ -259,7 +259,7 @@ public static bool RenderHelpURL(Type targetType) /// Render a documentation header with button for given url value /// /// Url to open if button is clicked - /// true if object drawn and button clicked, false otherwise + /// if object drawn and button clicked, otherwise. public static bool RenderDocumentationSection(string url) { bool result = false; @@ -292,7 +292,7 @@ public static bool FlexButton(GUIContent label, int index, ListButtonEvent callb /// /// A button that is as wide as the label /// - /// true if button clicked, false otherwise + /// if button clicked, otherwise. public static bool FlexButton(GUIContent label, int[] indexArr, MultiListButtonEvent callback, SerializedProperty prop = null) { if (FlexButton(label)) @@ -308,7 +308,7 @@ public static bool FlexButton(GUIContent label, int[] indexArr, MultiListButtonE /// A button that is as wide as the label /// /// content for button - /// true if button clicked, false otherwise + /// if button clicked, otherwise. public static bool FlexButton(GUIContent label) { GUIStyle buttonStyle = new GUIStyle(GUI.skin.button); @@ -328,7 +328,7 @@ public static bool FlexButton(GUIContent label) } /// - /// A button that is as wide as the available space + /// A button that is as wide as the available space. /// public static bool FullWidthButton(GUIContent label, float padding, int index, ListButtonEvent callback, SerializedProperty prop = null) { @@ -354,7 +354,7 @@ public static bool FullWidthButton(GUIContent label, float padding, int index, L } /// - /// A button that is as wide as the available space + /// A button that is as wide as the available space. /// public static bool FullWidthButton(GUIContent label, float padding, int[] indexArr, MultiListButtonEvent callback, SerializedProperty prop = null) { @@ -383,7 +383,7 @@ public static bool FullWidthButton(GUIContent label, float padding, int[] indexA /// A small button, good for a single icon like + or - with single index callback events /// /// content to place in the button - /// true if button selected, false otherwise + /// if button selected, otherwise. public static bool SmallButton(GUIContent label, int index, ListButtonEvent callback, SerializedProperty prop = null) { if (SmallButton(label)) @@ -399,7 +399,7 @@ public static bool SmallButton(GUIContent label, int index, ListButtonEvent call /// A small button, good for a single icon like + or - with multi-index callback events /// /// content to place in the button - /// true if button selected, false otherwise + /// if button selected, otherwise. public static bool SmallButton(GUIContent label, int[] indexArr, MultiListButtonEvent callback, SerializedProperty prop = null) { if (SmallButton(label)) @@ -415,7 +415,7 @@ public static bool SmallButton(GUIContent label, int[] indexArr, MultiListButton /// A small button, good for a single icon like + or - /// /// content to place in the button - /// true if button selected, false otherwise + /// if button selected, otherwise. public static bool SmallButton(GUIContent label) { GUIStyle smallButton = new GUIStyle(EditorStyles.miniButton); diff --git a/com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystemDescriptor.cs b/com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystemDescriptor.cs index 3db58725595..0fa5a5cf118 100644 --- a/com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystemDescriptor.cs +++ b/com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystemDescriptor.cs @@ -24,7 +24,7 @@ public class HandsSubsystemCinfo : MRTKSubsystemCinfo /// Tests for equality. /// /// The other to compare against. - /// if every field in is equal to this , otherwise false. + /// if every field in is equal to this , otherwise . public override bool Equals(MRTKSubsystemCinfo other) { return base.Equals(other) && IsPhysicalData == (other as HandsSubsystemCinfo)?.IsPhysicalData; diff --git a/com.microsoft.mrtk.core/Subsystems/MRTKSubsystemDescriptor.cs b/com.microsoft.mrtk.core/Subsystems/MRTKSubsystemDescriptor.cs index 6cb0149992d..f6cb58fe7af 100644 --- a/com.microsoft.mrtk.core/Subsystems/MRTKSubsystemDescriptor.cs +++ b/com.microsoft.mrtk.core/Subsystems/MRTKSubsystemDescriptor.cs @@ -38,7 +38,7 @@ public class MRTKSubsystemCinfo : /// Tests for equality. /// /// The other to compare against. - /// if every field in is equal to this , otherwise false. + /// if every field in is equal to this , otherwise . public virtual bool Equals(MRTKSubsystemCinfo other) { return diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs b/com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs index 14a23cb8a8c..55f54a7cc43 100644 --- a/com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs +++ b/com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs @@ -20,7 +20,7 @@ public class KeywordRecognitionSubsystemCinfo : MRTKSubsystemCinfo /// Tests for equality. /// /// The other to compare against. - /// if every field in is equal to this , otherwise false. + /// if every field in is equal to this , otherwise . public override bool Equals(MRTKSubsystemCinfo other) { return base.Equals(other) && IsCloudBased == (other as KeywordRecognitionSubsystemCinfo)?.IsCloudBased; diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/TextToSpeechSubsystemDescriptor.cs b/com.microsoft.mrtk.core/Subsystems/Speech/TextToSpeechSubsystemDescriptor.cs index a6e2fcf1cee..853ec723550 100644 --- a/com.microsoft.mrtk.core/Subsystems/Speech/TextToSpeechSubsystemDescriptor.cs +++ b/com.microsoft.mrtk.core/Subsystems/Speech/TextToSpeechSubsystemDescriptor.cs @@ -16,7 +16,7 @@ public class TextToSpeechSubsystemCinfo : MRTKSubsystemCinfo /// Tests for equality. /// /// The other to compare against. - /// if every field in is equal to this , otherwise false. + /// if every field in is equal to this , otherwise . public override bool Equals(MRTKSubsystemCinfo other) { // TODO: Add comparison of subsystem specific property values. diff --git a/com.microsoft.mrtk.core/Utilities/Extensions/BoundsExtensions.cs b/com.microsoft.mrtk.core/Utilities/Extensions/BoundsExtensions.cs index 9b022fb08f1..1c3d21476a0 100644 --- a/com.microsoft.mrtk.core/Utilities/Extensions/BoundsExtensions.cs +++ b/com.microsoft.mrtk.core/Utilities/Extensions/BoundsExtensions.cs @@ -244,7 +244,7 @@ public static class BoundsExtensions /// /// An invalid is one which has its size vector set to for /// all components. The center of an invalid bounds instance is the zero vector. - /// + /// public static Bounds GetInvalidBoundsInstance() { return new Bounds(Vector3.zero, GetInvalidBoundsSize()); @@ -256,7 +256,7 @@ public static Bounds GetInvalidBoundsInstance() /// /// A valid instance is one whose size vector does not have all /// components set to . - /// + /// public static bool IsValid(this Bounds bounds) { return bounds.size != GetInvalidBoundsSize(); @@ -847,7 +847,7 @@ public static Vector2[] GetScreenSpaceCornerPoints(this Bounds bounds, Camera ca Vector3 aabbCenter = bounds.center; Vector3 aabbExtents = bounds.extents; - // Return the screen space point array + // Return the screen space point array return new Vector2[] { camera.WorldToScreenPoint(new Vector3(aabbCenter.x - aabbExtents.x, aabbCenter.y - aabbExtents.y, aabbCenter.z - aabbExtents.z)), diff --git a/com.microsoft.mrtk.core/Utilities/Extensions/GameObjectExtensions.cs b/com.microsoft.mrtk.core/Utilities/Extensions/GameObjectExtensions.cs index 82509eb0e57..02fde86cf37 100644 --- a/com.microsoft.mrtk.core/Utilities/Extensions/GameObjectExtensions.cs +++ b/com.microsoft.mrtk.core/Utilities/Extensions/GameObjectExtensions.cs @@ -91,11 +91,11 @@ public static void ForEachComponent(this GameObject gameObject, Action act /// /// Checks if any MonoBehaviour on the given GameObject is using the RequireComponentAttribute requiring type T /// - /// Only functions when called within a UNITY_EDITOR context. Outside of UNITY_EDITOR, always returns false + /// Only functions when called within a UNITY_EDITOR context. Outside of UNITY_EDITOR, always returns . /// The potentially required component /// the GameObject requiring the component /// A list of types that do require the component in question - /// true if appears in any RequireComponentAttribute, otherwise false + /// if appears in any RequireComponentAttribute, otherwise . public static bool IsComponentRequired(this GameObject gameObject, out List requiringTypes) where T : Component { var genericType = typeof(T); diff --git a/com.microsoft.mrtk.core/Utilities/MathUtilities.cs b/com.microsoft.mrtk.core/Utilities/MathUtilities.cs index 523e69bdf69..25f04abd86f 100644 --- a/com.microsoft.mrtk.core/Utilities/MathUtilities.cs +++ b/com.microsoft.mrtk.core/Utilities/MathUtilities.cs @@ -331,7 +331,7 @@ public static bool TestPlanesAABB(Plane[] planes, int planeMask, Bounds bounds, /// The vector to test /// The lower bounds /// The upper bounds - /// true if in range, otherwise false + /// if in range, otherwise . public static bool InRange(Vector2 vec, Vector2 lower, Vector2 upper) { return vec.x >= lower.x && vec.x <= upper.x && vec.y >= lower.y && vec.y <= upper.y; @@ -343,7 +343,7 @@ public static bool InRange(Vector2 vec, Vector2 lower, Vector2 upper) /// The vector to test /// The lower bounds /// The upper bounds - /// true if in range, otherwise false + /// if in range, otherwise . public static bool InRange(Vector3 vec, Vector3 lower, Vector3 upper) { return vec.x >= lower.x && vec.x <= upper.x && vec.y >= lower.y && vec.y <= upper.y && vec.z >= lower.z && vec.z <= upper.z; diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCollection.cs b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCollection.cs index 0cff5ef59b1..b0dbb2dadc7 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCollection.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCollection.cs @@ -17,17 +17,21 @@ namespace Microsoft.MixedReality.Toolkit.Data /// /// /// + /// /// Each item in the collection can be of arbitrary type(s) and complexity, but there is an assumption that each item /// contains the same types of information and organized in the same way. Collections can be nested as well. - /// + /// + /// /// KeyPaths within a collection item are typically "local" or "view" key paths that are treated as relative paths /// that will then be combined with the fully resolved (absolute) keypath of the specific item in the collection container. - /// + /// + /// /// When a change in a collection is received, this object will instantiate game objects for each collection item /// using the specified prefab. That prefab can contain any number of its own Data Consumers. Note that the data consumers /// in an object should not be assigned a data source for any purpose other than testing. These data sources will be replaced when /// the prefab is instantiated and modified via data from the data source associated with this data consumer, /// whenever a request for one of the list items is made. + /// /// [AddComponentMenu("MRTK/Data Binding/Consumers/Data Consumer Collection")] public class DataConsumerCollection : DataConsumerGOBase, IDataConsumerCollection @@ -98,9 +102,8 @@ protected override void InitializeDataConsumer() } /// - /// Search through game object hierarchy for the nearest IDataCollectionItemPlacer implementation. + /// Search through game object hierarchy for the nearest implementation. /// - /// /// /// This protected method is unique to collection related Data Consumers. An Item Placer is used to /// place game objects (usually a prefab), into the viewers experience when all or a subset @@ -122,7 +125,6 @@ protected void FindNearestCollectionItemPlacer() /// /// Return the component types managed by this Data Consumer. /// - /// /// /// Normally this returns Unity specific component types, but this one only needs to manage itself. /// @@ -136,12 +138,11 @@ protected override Type[] GetComponentTypes() /// /// Report whether this data consumer should manage components in any of its child game objects. /// - /// /// /// A typical collection only manifests in a single list, so the default behavior is false, but can /// be overridden for handling more complex scenarios. /// - /// if manage DataConsumerCollection objects in this GO's children game objects, or if only manage this one. + /// if manage objects in this GO's children game objects, or if only manage this one. protected override bool ManageChildren() { return false; @@ -150,12 +151,13 @@ protected override bool ManageChildren() /// /// For all components managed by this data consumer, add keypath(s) to listen for. /// - /// /// + /// /// For a collection, the only keypath typically is the keypath explicitly assigned to this collection by the inspector. /// This keypath is for the collection itself in the data source. For example, if this list is designed to show an address /// book of contacts, and the JSON data for the data source looks like this: - /// + /// + /// /// { /// "data_result" : /// { @@ -176,13 +178,12 @@ protected override bool ManageChildren() /// } /// } /// } - /// - /// then the key path would be: "data_result.address_books.primary_contacts.persons" - /// + /// + /// + /// Then the key path would be: data_result.address_books.primary_contacts.persons. + /// /// - /// /// The component of that type, typically the game object on which this script exists. - /// protected override void AddVariableKeyPathsForComponent(Component component) { if (collectionKeyPath != null) @@ -200,15 +201,14 @@ protected override void AddVariableKeyPathsForComponent(Component component) /// /// /// - /// The only key path typically reported is the keypath provided by AddVariableKeyPathsForComponent, which is the + /// The only key path typically reported is the keypath provided by , which is the /// key path of the collection itself in the data source. - /// /// /// /// The data source reporting a data change in the collection. /// Fully resolved key path after key mapping and disambiguating any parent collections. /// the originally provided local key path, usually the one provided in the Unity inspector. - /// An object that represents the changed collection or item in the collection, typically its index. + /// An object that represents the changed collection or item in the collection, typically its index. /// The nature of the data change, either at collection level or individual item level. protected override void ProcessDataChanged(IDataSource dataSource, string resolvedKeyPath, string collectionLocalKeypath, object itemIdentifier, DataChangeType dataChangeType) { @@ -274,10 +274,7 @@ protected IEnumerator FetchPrefabs(int indexRangeStart, int indexRangeCount) /// /// Request the specified range of items and provide them to the item placer. /// - /// - /// - /// See RequestCollectionItems() method of IDataConsumer interface. - /// + /// public void RequestCollectionItems(IDataCollectionItemPlacer itemPlacer, int indexRangeStart, int indexRangeCount, object requestRef) { itemPlacer.StartPlacement(); @@ -289,13 +286,17 @@ public void RequestCollectionItems(IDataCollectionItemPlacer itemPlacer, int ind /// /// /// + /// /// For the specified range, instantiate prefabs and provide them to the specified item placer. - /// + /// + /// /// Any prefab data consumers in the prefab are automatically connected to the same data source as the collection itself, and /// its key path prefix is set to the full resolve prefix for this collection combined with the array index position of the item in the /// array. - /// - /// NOTE: If you need to know that an item has been created, override ItemAdded(). + /// + /// + /// NOTE: If you need to know that an item has been created, override . + /// /// /// /// Item placer to receive the specified range of prefabs. @@ -340,7 +341,7 @@ protected void InstantiatePrefabs(IDataCollectionItemPlacer itemPlacer, int inde /// Optional logic that can be provided by a subclasses that's triggered when an item is added to this collection. /// /// The collection item index of the item being added. - /// The gameobject or prefab being added. + /// The game object or prefab being added. public virtual void ItemAdded(int itemIndex, GameObject itemPrefab) { // No default behavior. Provided to override if useful. @@ -350,7 +351,7 @@ public virtual void ItemAdded(int itemIndex, GameObject itemPrefab) /// Optional logic that can be provided by a subclasses that's triggered when an item is removed from collection. /// /// The collection item index of the item being removed. - /// The gameobject or prefab being removed. + /// The game object or prefab being removed. public virtual void ItemRemoved(int itemIndex, GameObject itemPrefab) { // No default behavior. Provided to override if useful. @@ -363,7 +364,6 @@ public virtual void ItemRemoved(int itemIndex, GameObject itemPrefab) /// /// Return the collection size at the time of this call. Note that no attempt is made to track changes in collection makeup or size /// during the course of processing a collection. - /// /// /// Collection size. public int GetCollectionItemCount() @@ -467,10 +467,13 @@ protected void InitializePrefabInstance(int itemIndex, GameObject go) /// /// /// + /// /// This is the mechanism for returning a prefab to a pool of available prefabs so that they /// can be repopulated with new embedded data, but otherwise are ready-to-go. - /// - /// Note: If you need to know when an item has been removed, override ItemRemoved(). + /// + /// + /// Note: If you need to know when an item has been removed, override . + /// /// /// /// Index of the game object being returned. @@ -589,7 +592,7 @@ protected Transform GetPrefabCollectionParent() } /// - /// Update all IDataConsumer Components in the prefab GO hierarchy. + /// Update all components in the prefab GO hierarchy. /// /// /// diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCommandDispatcher.cs b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCommandDispatcher.cs index d6bd4388e0c..f85b30d3d8e 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCommandDispatcher.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCommandDispatcher.cs @@ -14,17 +14,21 @@ namespace Microsoft.MixedReality.Toolkit.Data /// Dispatch commands along with reference data bound to this consumer. /// /// + /// /// This command dispatcher is useful for enabling UX elements, such as action buttons, to /// invoke functionality that is specific to this instance of an data bound entity. This /// is particularly useful in combination with DataConsumerCollection where each item /// is bound to different data and yet each item may wish to invoke functionality specific to /// itself via some form of unique identifier. - /// + /// + /// /// As an example, given a list of contacts that has been populated via data binding, each entry may have /// an "Edit" and a "Delete" button for that contact. With this component, it's possible to invoke a /// command from the "Edit" and "Delete" button prefabs that is automatically bound to the correct "contactID" /// field so that the command receiver is able to invoke the appropriate functionality for the specific - /// contact associated with the contact ID. + /// contact associated with the contact ID. + /// + /// [AddComponentMenu("MRTK/Data Binding/Consumers/Data Consumer Command Dispatcher")] public class DataConsumerCommandDispatcher : DataConsumerGOBase { @@ -62,12 +66,13 @@ public virtual void SendCommand(string command) } /// - /// Send a command through the Data Controller with optional parameters + /// Send a command through the , with optional parameters /// /// /// If optional parameters are needed, this method allows for these to be passed in. /// /// The command to send. + /// The set of key-vair pairs to send as command parameters. public virtual void SendCommand(string command, Dictionary optionalParameters) { if (DataController != null) diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerGOBase.cs b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerGOBase.cs index 64bb0a67bc9..1d87a18f496 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerGOBase.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerGOBase.cs @@ -564,11 +564,11 @@ protected virtual IDataSource GetBestDataSource(string dataTypeHint = "data") return null; } - /// /// Add a key path to the data source so that this object will be notified when it has changed. /// /// Local key path prior to any key path mapping or resolving. + /// The specific data source to add a listener too. If null, the is used to resolve the data source. /// The fully resolved keypath for the specified local keypath. protected string AddKeyPathListener(string localKeyPath, IDataSource specificDataSource = null) { diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemableBase.cs b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemableBase.cs index 7c15c53683d..8131b590e0d 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemableBase.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemableBase.cs @@ -32,7 +32,7 @@ public DataBindingProfile[] DataBindingProfiles } /// - /// All additional information related to a single DataBindingProfile. + /// All additional information related to a single . /// protected class BindingInfo { @@ -60,7 +60,7 @@ protected class BindingInfo /// /// Object of correct type provided directly /// Numeric index lookup - /// pair lookup + /// key-value pair lookup /// Resource path to load a Unity resource ("resource://pathToUnityResource") /// Streaming asset path to a file that can be loaded using any appropriate means ("file://pathToUnityStreamingAsset") /// @@ -98,33 +98,42 @@ public override bool ConfigureFromBindingProfile(string[] dataSourceTypes, DataB protected abstract void SetObject(Component component, object inValue, T objectToSet); /// - /// Given an int N, get the nth entry in lookup as a theme keypath to retrieve theme value + /// Get a value within a binding profile using the theme key path at index . /// /// + /// /// Override this method to support data sources that provide integral values /// that can be then used as an index lookup of the appropriate theme /// relative or absolute keypath. If not already present in the returned /// value, the keypath will be appended to the base keypath /// provided in the DataConsumerThemeHelper. - /// - /// Example: - /// + /// + /// + /// For example: + /// + /// /// Given the stored value is an integer status where 0=new, 1=in progress and 2=done /// and it is desired to load a sprite for the correct status in the look and feel of /// the current theme. - /// - /// The local lookup in the derived class can be structured as an absolute keypath as follows: + /// + /// + /// The local lookup in the derived class can be structured as an absolute keypath as follows: + /// + /// /// 0 : Status.Sprites.New /// 1 : Status.Sprites.InProgress /// 2 : Status.Sprites.Done - /// + /// + /// /// This keypath returned from this method will be used to retrieve its value via the - /// DataConsuemerThemeHelper. Whatever value is stored in the matching field of the + /// . Whatever value is stored in the matching field of the /// theme data source will then be used to autodetect the method of retrieving the /// final sprite and the sprite will be retrieved and returned. + /// /// - /// Index for looking up object of type T - /// Found object of type T or null if not found + /// The binding to use when looking up the value at index in the array. + /// Index for looking up object of type + /// Found object of type or if not found. protected virtual T GetObjectByThemeLookupIndex(BindingInfo binding, int n) { if (n < binding.BindingProfile.ValueToThemeKeypathLookup.Length) @@ -137,6 +146,9 @@ protected virtual T GetObjectByThemeLookupIndex(BindingInfo binding, int n) } } + /// + /// Get a value within a binding profile using this string. + /// /// /// Given a string key, lookup desired theme keypath to retrieve the theme value. /// @@ -147,6 +159,7 @@ protected virtual T GetObjectByThemeLookupIndex(BindingInfo binding, int n) /// value, the keypath will be appended to the base keypath /// provided in the DataConsumerThemeHelper. /// + /// The binding to use when resolve the request object at index /// Key value provided by data source /// Found object of type T or null if not found protected virtual T GetObjectByThemeLookupKey(BindingInfo binding, string keyValue) @@ -316,13 +329,29 @@ protected virtual T LoadStreamingAsset(string assetPath) /// /// /// The object can be any of a number of types and loaded accordingly: - /// - /// int Use as index to select Nth entry in ValueToObjectInfo - /// T Directly use the value to replace the managed variable of that type - /// "resource://<>" Use path to load a Unity Resource - /// "file://<>" Use path to load a streaming asset - /// other string Use string value to find entry by value in ValueToObjectInfo - /// + /// + /// + /// + /// int + /// Use as index to select Nth entry in ValueToObjectInfo. + /// + /// + /// T + /// Directly use the value to replace the managed variable of that type. + /// + /// + /// "resource://[path]" + /// Use path to load a Unity Resource. + /// + /// + /// "file://[path]" + /// Use path to load a streaming asset. + /// + /// + /// other string + /// Use string value to find entry by value in ValueToObjectInfo. + /// + /// /// /// Which data source called this method. /// Fully resolved keypath for datum that changed. diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemeHelper.cs b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemeHelper.cs index a5d8e04dba3..ceb284efed9 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemeHelper.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemeHelper.cs @@ -10,7 +10,7 @@ namespace Microsoft.MixedReality.Toolkit.Data { /// - /// A theme data consumer used to help another primary data consumer derived from DataConsumeThemableBase + /// A theme data consumer used to help another primary data consumer derived from /// that is designed to manage both dynamically bound data received from a data-centric DataSource, and /// then theme that dynamic data. As an example, a numeric status can be used to look up an appropriate /// status icon for the current status. That icon can then be further themed to adopt the desired, branding or @@ -105,13 +105,29 @@ public IDataSource GetThemeDataSource() /// /// /// The object can be any of a number of types and loaded accordingly: - /// - /// int Use as index to select Nth entry in ValueToObjectInfo - /// T Directly use the value to replace the managed variable of that type - /// "resource://<>" Use path to load a Unity Resource - /// "file://<>" Use path to load a streaming asset - /// other string Use string value to find entry by value in ValueToObjectInfo - /// + /// + /// + /// + /// int + /// Use as index to select Nth entry in ValueToObjectInfo. + /// + /// + /// T + /// Directly use the value to replace the managed variable of that type. + /// + /// + /// "resource://[path]" + /// Use path to load a Unity Resource. + /// + /// + /// "file://[path]" + /// Use path to load a streaming asset. + /// + /// + /// other string + /// Use string value to find entry by value in ValueToObjectInfo. + /// + /// /// /// Which data source called this method. /// Fully resolved keypath for datum that changed. diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataParser.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataParser.cs index 806a74a7b01..88bc36c8583 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataParser.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataParser.cs @@ -237,10 +237,15 @@ public static bool FindKeypathToken(string str, out int start, out int end) return start != -1; // If we never found a start character, this isn't a token. } - /// This is a simplified integer parser that works from a + /// + /// This is a simplified integer parser that works from a /// substring, avoiding the need to allocate a separate substring - /// variable. It does _not_ handle trailing or leading spaces. + /// variable. It does not handle trailing or leading spaces. + /// /// String parent to parse. + /// The index at which to start parsing. Parsing will include the character at this index. + /// The index at which to stop parsing. Parsing will stop with the character immediately before this index. + /// The resulting integer result. public static bool TryParseIntSubstring(string str, int start, int end, out int result) { int multiplier = 1; diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataSourceProviderSingleton.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataSourceProviderSingleton.cs index 94e904aa2a5..2f25c9a09c3 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataSourceProviderSingleton.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataSourceProviderSingleton.cs @@ -14,8 +14,14 @@ namespace Microsoft.MixedReality.Toolkit.Data /// /// Inherit from this base class to create a singleton. - /// e.g. public class MyClassName : Singleton {} /// + /// + /// An example usage may look like: + /// + /// + /// public class MyClassName : Singleton<MyClassName> {} + /// + /// [Serializable] [AddComponentMenu("MRTK/Data Binding/Sources/Data Source Provider Singleton")] public class DataSourceProviderSingleton : MonoBehaviour, IDataSourceProvider diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumer.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumer.cs index b1d21ec9d20..42433d1dd0b 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumer.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumer.cs @@ -10,27 +10,37 @@ namespace Microsoft.MixedReality.Toolkit.Data { /// - /// Interface for all data consumers. A data consumer is the intermediary between a data source and a view used to + /// Interface for all data consumers. + /// + /// + /// + /// A data consumer is the intermediary between a data source and a view used to /// present information. The view will typically be a prefab where specific pieces of information identify which /// datum will be used to modify that presented information at runtime. - /// + /// + /// /// Key Concepts: - /// + /// + /// /// Key Path (string) - See IDataSource for more information. A key path identifies a specific datum in the data source. /// That datum may be a primitive, or an entire data subset. - /// + /// + /// /// Change Set - A grouping of data changes. All data source notifications of changed data will be within a Change Set. /// This allows for multiple related changes to be grouped into one atomic update of a data view. This is critical when /// multiple data items influence a single piece of presented information, like a single sentence with 3 pieces of variable /// information. - /// + /// + /// /// Data Change Notifications - All changes to a data source are provide via change notifications. Every data consumer can /// sign up to listen or any number of data changes to specific data items within the data source. Also multiple consumers /// can listen to the same data source. - /// - /// For data that represents a collection (e.g. list) of items, a data consumer can request specific subsets of that list. + /// + /// + /// For data that represents a collection or list of items, a data consumer can request specific subsets of that list. /// This allows for pagination and for virtualization, which is critical for supporting large data sets. - /// + /// + /// public interface IDataConsumer { /// diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumerThemable.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumerThemable.cs index bd4da79e52f..4c0f9754d90 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumerThemable.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumerThemable.cs @@ -14,17 +14,33 @@ public interface IDataConsumerThemable /// /// /// The object can be any of a number of types and loaded accordingly: - /// - /// int Use as index to select Nth entry in ValueToObjectInfo - /// T Directly use the value to replace the managed variable of that type - /// "resource://<>" Use path to load a Unity Resource - /// "file://<>" Use path to load a streaming asset - /// other string Use string value to find entry by value in ValueToObjectInfo - /// + /// + /// + /// + /// int + /// Use as index to select Nth entry in ValueToObjectInfo. + /// + /// + /// T + /// Directly use the value to replace the managed variable of that type. + /// + /// + /// "resource://[path]" + /// Use path to load a Unity Resource. + /// + /// + /// "file://[path]" + /// Use path to load a streaming asset. + /// + /// + /// other string + /// Use string value to find entry by value in ValueToObjectInfo. + /// + /// /// /// The theme helper data consumer that called this method. - /// - /// >Local keypath for the datum that changed. + /// Fully resolved keypath for datum that changed. + /// Local keypath for the datum that changed. /// The current value of the theme data. /// The type of change that has occurred. void ProcessThemeDataChanged(IDataConsumer themeHelper, string resolvedKeyPath, string localKeyPath, object themeValue, DataChangeType dataChangeType); diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataKeyPathMapper.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataKeyPathMapper.cs index 38949e1f1b0..659240b476a 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataKeyPathMapper.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataKeyPathMapper.cs @@ -8,20 +8,26 @@ namespace Microsoft.MixedReality.Toolkit.Data { /// - /// Interface for a Key Path Mapper that is used to translate between data source namespaces - /// and view name spaces. Any key path mapper can be dependency injected into any data source. + /// Interface for a key-path mapper that is used to translate between data source namespaces + /// and view namespaces. + /// + /// + /// + /// Any key path mapper can be dependency injected into any data source. /// This allows reusable view prefabs to be populated from any variety of data sources /// containing similar information. - /// - /// If no Key Path Mapper is assigned to a data source, then the view and data source keypaths + /// + /// + /// If no Key Path Mapper is assigned to a data source, then the view and data source key paths /// are assumed to be the same. - /// + /// + /// /// TODO: Consider adding a namespace argument so that a single key mapper can map multiple /// different views to the same data source without a chance of naming conflicts. /// In this case, the combination of namespace and local (view) key path would be used /// to look up the correct mapping. - /// - /// + /// + /// public interface IDataKeyPathMapper { /// diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataNode.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataNode.cs index 74f12a64653..cf6f368f47b 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataNode.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataNode.cs @@ -17,7 +17,6 @@ namespace Microsoft.MixedReality.Toolkit.Data /// /// This is used by a data source to organize information that matches the /// defacto standard key path format that's modeled on JSON/javascript. - /// /// public enum DataNodeType { @@ -25,7 +24,11 @@ public enum DataNodeType Null, Array, Map, - Other // primitives, strings, or complex objects not navigable. + + /// + /// Represents primitives, strings, or complex objects not navigable. + /// + Other } public interface IDataNode @@ -34,14 +37,14 @@ public interface IDataNode /// Is this node an array of other nodes? /// /// - /// true if an array, false otherwise. + /// if an array, otherwise. bool IsArray(); /// /// Is this node a map (dictionary) to other nodes? /// /// - /// true if a map, false otherwise. + /// if a map, otherwise. bool IsMap(); /// @@ -54,7 +57,7 @@ public interface IDataNode /// knowing what type it should be. /// /// - /// true if unassigned, false otherwise. + /// if unassigned, otherwise. bool IsUnassigned(); /// @@ -69,34 +72,29 @@ public interface IDataNode /// /// Return the child node of a map node by its key. /// - /// /// The key specifying which child node to return. - /// /// The child node for specified key, if this is a map node and the key exists, or null otherwise. IDataNode GetNodeByKey(string key); /// /// Get the value associated with this node. /// - /// /// - /// If this node is an array node, the value is an IEnumerable object that - /// contains all the keypaths of its children. Note that this is not the usual way of - /// retrieving items in an array since paging is not possible. See - /// IEnumerable GetCollectionKeyPathRange() for a better method of + /// If this node is an array node, the value is a object that + /// contains all the key paths of its children. Note that this is not the usual way of + /// retrieving items in an array since paging is not possible. See + /// for a better method of /// accessing members of a collection. /// - /// If this node is a map node, the value is an IEnumerable object + /// If this node is a map node, the value is a object /// that contains the full keypath for every key in the map. /// - /// /// The value associated with this node of arbitrary type and complexity object GetValue(); /// /// Set the value associated with this node. /// - /// /// /// The value can be of arbitrary type and complexity. /// @@ -109,19 +107,16 @@ public interface IDataNode /// /// Get the type for this node. /// - /// /// /// An alternative way to determine the type is by using the IsArray(), IsMap() and IsUnassigned() /// methods. /// - /// /// The type for this node. DataNodeType GetNodeType(); /// /// Set the type, and the associated value for this node. /// - /// /// /// The primary use of this is to convert an unassigned node to /// a node of a specific type. @@ -134,10 +129,8 @@ public interface IDataNode /// If the new type is an array or a map, the value argument is ignored /// even if not null. /// - /// /// The new type for this node /// The value to be associated with this node. - /// void SetNodeType(DataNodeType newNodeType, object value = null); /// diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataSource.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataSource.cs index bb0fee03763..ff6e801fe45 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataSource.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataSource.cs @@ -24,65 +24,76 @@ public enum DataChangeType } /// - /// Interface for all data sources. A data source is any managed set of data + /// Interface for all data sources. + /// + /// + /// + /// A data source is any managed set of data /// that can be used to populate a data view via a data consumer. This data /// can be static or dynamic, with any changes being reported to any data consumers /// who have registered to receive change notifications. - /// + /// + /// /// Key concepts: - /// - /// Key Path (string) - a unique accessor to specific data items within a data set. + /// + /// + /// Key Path () - a unique accessor to specific data items within a data set. /// Although a Key Path can be any unique identifier per data item, all /// current implementations use the concept of a logical user readable /// specifier that indicates the navigational position of the data of interest /// relative to the entire data set. It is modelled on javascript's concept of - /// lists, dictionaries and primitives, such that keypaths are correct javascript + /// lists, dictionaries and primitives, such that key paths are correct javascript /// statements for accessing data that can be represented in JSON. The advantage /// of this approach is that it correlates very well with both JSON and XML, - /// which are the two most prevalent means of transferring information from back-end services. - /// - /// Example key paths: - /// + /// which are the two most prevalent means of transferring information from back-end services. Example key paths: + /// + /// /// temperature /// contacts[10].firstName /// contacts /// contacts[10].addresses[3].city /// [10].title /// kingdom.animal.mammal.aardvark.diet.foodtypes.termites - /// + /// + /// /// Given that a key path is an arbitrary string with no required taxonomy, the actual /// data specifiers could be any method of describing what data to retrieve. XML's XPath is an /// example of a viable key path schema. As long as key paths provided by the data consumer - /// are consistent with the keypaths expected by the data source, everything will work. + /// are consistent with the key paths expected by the data source, everything will work. /// Furthermore Key Path Mappers can be implemented to translate between different schemas. - /// - /// Resolving a keypath means combining two keypaths: 1) a keypath describes how to access a specific + /// + /// + /// Resolving a keypath means combining two key paths: 1) a keypath describes how to access a specific /// subset of a larger dataset, such as one entry in a list of many entries, and 2) /// a partial (relative) keypath that represents just a datum within that list or map entry. /// This makes it possible to treat a subset of the data in such a way that it does /// not matter where in a larger data set hierarchy it actually exists. The most critical /// use of this ability is to describe the data of a single entry in a list without worrying about which /// entry in that list the current instance is referencing. - /// - /// Key Path Mapper (IDataKeyPathMapper) - A dependency injected helper that can map + /// + /// + /// Key Path Mapper () - A dependency injected helper that can map /// between namespaces used in a data set and name spaces used in a view object, like - /// a prefab meant to be re-usable with different data sources, like a contact list. - /// - /// Data Consumer (IDataConsumer) - An object that knows how to consume information being managed by + /// a prefab meant to be re-usable with different data sources, like a contact list. + /// + /// + /// Data Consumer () - An object that knows how to consume information being managed by /// a data source and use that data to populate data views. - /// + /// + /// /// Data Consumer Listener - Data Consumers that have registered to be notified of any changes to a specific /// data item in a dataset. Whenever the data specified has changed (or suspected to have changed), the /// Data Consumer(s) will be notified. - /// + /// + /// /// Collection - Any subset of the data source that is a repeated array of the same types of information. This /// special consideration of the structure of the data is critical for populating list views where items /// are presented in a list. Data sources and data consumers can support nested lists, such as a list of keywords /// associated with each photo in a list of photos. The keypath for the keywords would be relative to the photo, /// and the keypath for the photos would be relative to the list, and the keypath of the list would be relative /// to either the nearest parent list, or the root of the data set. - /// - /// + /// + /// public interface IDataSource { /// @@ -116,13 +127,12 @@ public interface IDataSource /// /// /// - /// If the view (data consumer) uses generic keyPaths that are not the same as the data source, then this - /// mapper will translate between data and view keyPaths. This allows a generic view to be used with a wide + /// If the view (data consumer) uses generic key paths that are not the same as the data source, then this + /// mapper will translate between data and view key paths. This allows a generic view to be used with a wide /// variety of data sources without modification. /// /// - /// Data keyPath mapper to assign. - + /// Data keyPath mapper to assign. void SetDataKeyPathMapper(IDataKeyPathMapper dataKeyPathMapper); /// @@ -132,19 +142,19 @@ public interface IDataSource /// Given a resolved (data source namespace) keyPath, and a local (data consumer namespace) keypath, /// return a fully resolved data source keyPath for that data item. /// - /// This resolvedKeyPathPrefix can be "" (empty string) if the localKeyPath represents an - /// absolute location in the data set. If the localKeyPath is a member of one item in + /// This can be an empty string if the represents an + /// absolute location in the data set. If the is a member of one item in /// an array of items, then the prefix will be that of the data container itself containing /// the array /// /// If the specified item can not be found in the data source, null is returned. /// /// - /// The data path prefix. - /// The local keyPat to resolve. Note that this may be mapped by a DataKeyPathMapper + /// The data path prefix. + /// The local keyPat to resolve. Note that this may be mapped by a /// /// A string that can be used to map to a view data consumer. - string ResolveKeyPath(string resolvedkeyPathPrefix, string locakKeyPath); + string ResolveKeyPath(string resolvedKeyPathPrefix, string localKeyPath); /// /// Get the value associated with the specified keyPath and prefix @@ -156,12 +166,12 @@ public interface IDataSource /// /// The fullyQualifiedPrefix is provided for lists (or collection of lists) to find the correct instance of a specific local keypath. /// If not processing a collection, this can be either null or "". It is considered fully qualified because it has been resolved - /// to the namespaces of the data source where each subcomponent may have been mapped from a view keyPath to a data keyPath. + /// to the namespaces of the data source where each sub-component may have been mapped from a view keyPath to a data keyPath. /// This means that the path may not be recognizable on casual observation relative to the keyPath variables - /// embedded in views and subviews. + /// embedded in views and sub-views. /// /// Note that a keyPath for a collection is useful for regenerating an entire collection. If the object is a collection, - /// GetValue() returns an IEnumberable that can be used to enumerate the keypaths of all children in the collection. + /// returns an that can be used to enumerate the key paths of all children in the collection. /// /// /// @@ -182,9 +192,9 @@ public interface IDataSource /// /// The fullyQualifiedPrefix is provided for lists (or collection of lists) to find the correct instance of a specific local keypath. /// If not processing a collection, this can be either null or "". It is considered fully qualified because it has been resolved - /// to the namespaces of the data source where each subcomponent may have been mapped from a view keyPath to a data keyPath. + /// to the namespaces of the data source where each sub-component may have been mapped from a view keyPath to a data keyPath. /// This means that the path may not be recognizable on casual observation relative to the keyPath variables - /// embedded in views and subviews. + /// embedded in views and sub-views. /// /// Although not fully implemented yet, it could also be used to persist changes to a back-end data store of some kind, /// such as might be useful for a data entry form. @@ -275,14 +285,14 @@ public interface IDataSource /// /// /// - /// This is useful for list virtualization where you only fetch the subportion of the list that is + /// This is useful for list virtualization where you only fetch the sub-portion of the list that is /// currently visible. /// /// /// The keyPath of the collection itself. /// The index of the first element of the desired range. /// The number of entries to return, (or fewer if end of collection is reached). - /// A string enumerable for all the fully resolved keypaths in the specified range. + /// A string enumerable for all the fully resolved key paths in the specified range. IEnumerable GetCollectionKeyPathRange(string resolvedKeyPath, int rangeStart, int rangeCount); /// @@ -316,7 +326,7 @@ public interface IDataSource /// Inform data source that its data has changed /// /// - /// This is used in situations where SetValue() is not being used to modify + /// This is used in situations where is not being used to modify /// the managed data, and the data source is not otherwise aware that the data /// has changed. This directly propagates the notification to all data consumers /// who are listening for this specific keyPath. @@ -333,21 +343,24 @@ public interface IDataSource /// /// /// - /// + /// /// This method is useful for batching multiple changes before notifying data consumers. An example situation - /// is when initially populating a static dataset before notifying dataconsumers of the availability of data. Eg: - /// + /// is when initially populating a static dataset before notifying data consumers of the availability of data. For example: + /// + /// /// SetValue( keypath1, value1 ); /// ... /// SetValue( keypathn, valuen ); /// DataChangeSetBegin(); /// NotifyAllChanged(); /// DataChangeSetEnd(); - /// + /// + /// /// Note that this currently will be less efficient than triggering changes on individual data items as they occur. /// In the current implementation, all listeners will be notified even if that particular data items has not /// actually been changed. In future versions, a list will be maintained of all changed items to make this /// option more efficient. + /// /// void NotifyAllChanged(DataChangeType dataChangeType = DataChangeType.DatumModified, IDataConsumer whichConsumer = null); @@ -356,7 +369,7 @@ public interface IDataSource /// /// /// This is useful for data sources that may need time to fetch data and may not be able to provide data yet - /// for a GetValue() method call. + /// for a method call. /// bool IsDataAvailable(); } diff --git a/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs b/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs index 62254c5cc79..178911dd59e 100644 --- a/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs +++ b/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs @@ -255,17 +255,21 @@ public static IEnumerator SetHandTrackingState(Handedness handedness, bool isTra } /// - /// Moves the hand from startPos to endPos, rotates the hand from startRot to endRot, and lerps the pinchedness - /// based on the provided handshapeId. - /// - /// - /// Note that numSteps defaults to a value of -1, which is a sentinel value to indicate that the - /// default number of steps should be used (i.e. ControllerMoveSteps). ControllerMoveSteps is not a compile - /// time constant, which is a requirement for default parameter values. + /// Update the test hand's position, rotation, and shape. + /// + /// + /// This moves the hand from to , rotates the hand from + /// to , and smooths the handshape + /// based on the provided over the number of steps provided by . + /// + /// + /// The parameter defaults to a value of -1, which is a sentinel value to indicate that the + /// default number of steps should be used as specified by . + /// /// public static IEnumerator UpdateHand( - Vector3 startPos, Vector3 endPos, - Quaternion startRot, Quaternion endRot, + Vector3 startPosition, Vector3 endPosition, + Quaternion startRotation, Quaternion endRotation, HandshapeId handshapeId, Handedness handedness, int numSteps = ControllerMoveStepsSentinelValue) { @@ -285,8 +289,8 @@ public static IEnumerator UpdateHand( float t = i / (float)numSteps; Pose handPose = new Pose( - Vector3.Lerp(startPos, endPos, t), - Quaternion.Lerp(startRot, endRot, t) + Vector3.Lerp(startPosition, endPosition, t), + Quaternion.Lerp(startRotation, endRotation, t) ); float pinchAmount = Mathf.Lerp(startPinch, isPinching ? 1 : 0, t); @@ -310,76 +314,97 @@ public static IEnumerator UpdateHand( yield return null; } } - +/ /// - /// Moves the hand from startPos to endPos and lerps the pinchedness based on the provided handshapeId. + /// Move the test hand. /// /// - /// Note that numSteps defaults to a value of -1, which is a sentinel value to indicate that the - /// default number of steps should be used (i.e. ControllerMoveSteps). ControllerMoveSteps is not a compile - /// time constant, which is a requirement for default parameter values. + /// + /// This moves the hand from to , and smooths the handshape + /// based on the provided over the number of steps provided by . + /// + /// + /// + /// The parameter defaults to a value of -1, which is a sentinel value to indicate that the + /// default number of steps should be used as specified by . + /// /// public static IEnumerator MoveHand( - Vector3 startPos, Vector3 endPos, + Vector3 startPosition, Vector3 endPosition, HandshapeId handshapeId, Handedness handedness, int numSteps = ControllerMoveStepsSentinelValue) { SimulatedController controller = handedness == Handedness.Right ? rightController : leftController; Quaternion rot = controller.WorldRotation; - return UpdateHand(startPos, endPos, rot, rot, handshapeId, handedness, numSteps); + return UpdateHand(startPosition, endPosition, rot, rot, handshapeId, handedness, numSteps); } /// - /// Moves the hand to newPos from its current position and lerps the pinchedness based on the provided handshapeId. + /// Move the test hand. /// /// - /// Note that numSteps defaults to a value of -1, which is a sentinel value to indicate that the - /// default number of steps should be used (i.e. ControllerMoveSteps). ControllerMoveSteps is not a compile - /// time constant, which is a requirement for default parameter values. + /// + /// This moves the hand to , and smooths the handshape based on the provided + /// over the number of steps provided by . + /// + /// + /// The parameter defaults to a value of -1, which is a sentinel value to indicate that the + /// default number of steps should be used as specified by . + /// /// public static IEnumerator MoveHandTo( - Vector3 newPos, HandshapeId handshapeId, Handedness handedness, + Vector3 newPosition, HandshapeId handshapeId, Handedness handedness, int numSteps = ControllerMoveStepsSentinelValue) { Vector3 pos = GetHandPose(handedness).position; - return MoveHand(pos, newPos, handshapeId, handedness, numSteps); + return MoveHand(pos, newPosition, handshapeId, handedness, numSteps); } /// - /// Rotates the hand from startRot to endRot and lerps the pinchedness based on the provided handshapeId. + /// Rotate the test hand. /// /// - /// Note that numSteps defaults to a value of -1, which is a sentinel value to indicate that the - /// default number of steps should be used (i.e. ControllerMoveSteps). ControllerMoveSteps is not a compile - /// time constant, which is a requirement for default parameter values. + /// + /// This rotates the hand from to , and smooths the handshape + /// based on the provided over the number of steps provided by . + /// + /// + /// The parameter defaults to a value of -1, which is a sentinel value to indicate that the + /// default number of steps should be used as specified by . + /// /// public static IEnumerator RotateHand( - Quaternion startRot, Quaternion endRot, + Quaternion startRotation, Quaternion endRotation, HandshapeId handshapeId, Handedness handedness, int numSteps = ControllerMoveStepsSentinelValue) { SimulatedController controller = handedness == Handedness.Right ? rightController : leftController; Vector3 pos = GetHandPose(handedness).position; - return UpdateHand(pos, pos, startRot, endRot, handshapeId, handedness, numSteps); + return UpdateHand(pos, pos, startRotation, endRotation, handshapeId, handedness, numSteps); } /// - /// Rotates the hand to newRot from its current rotation and lerps the pinchedness based on the - /// provided handshapeId. + /// Rotate the test hand. /// /// - /// Note that numSteps defaults to a value of -1, which is a sentinel value to indicate that the - /// default number of steps should be used (i.e. ControllerMoveSteps). ControllerMoveSteps is not a compile - /// time constant, which is a requirement for default parameter values. + /// + /// This rotates the hand to , and smooths the handshape based on the provided + /// over the number of steps provided by . + /// + /// + /// + /// The parameter defaults to a value of -1, which is a sentinel value to indicate that the + /// default number of steps should be used as specified by . + /// /// public static IEnumerator RotateHandTo( - Quaternion newRot, HandshapeId handshapeId, Handedness handedness, + Quaternion newRotation, HandshapeId handshapeId, Handedness handedness, int numSteps = ControllerMoveStepsSentinelValue) { SimulatedController controller = handedness == Handedness.Right ? rightController : leftController; Quaternion rot = controller.WorldRotation; - return RotateHand(rot, newRot, handshapeId, handedness, numSteps); + return RotateHand(rot, newRotation, handshapeId, handedness, numSteps); } /// @@ -402,6 +427,22 @@ public static IEnumerator PointHandToTarget(Vector3 target, HandshapeId handshap } + /// + /// Set the handshape of the test hand. + /// + /// + /// + /// This smooths the handshape based on the provided/ over the number of + /// steps provided by . + /// + /// + /// The parameter defaults to a value of -1, which is a sentinel value to indicate that the + /// default number of steps should be used as specified by . + /// + /// + /// The new handshape to apply to the test hand. + /// Specifies to the left or right test hand. + /// The number of steps to take when smoothing the change to the next handshape. The more step, the smoother the transition. public static IEnumerator SetHandshape(HandshapeId handshapeId, Handedness handedness, int numSteps = ControllerMoveStepsSentinelValue) { SimulatedController controller = handedness == Handedness.Right ? rightController : leftController; @@ -489,9 +530,10 @@ public static IEnumerator RotateCameraToTarget(Vector3 target) /// Moves eye gaze rotation from the start rotation to the end rotation. /// /// - /// Note that numSteps defaults to a value of -1, which is a sentinel value to indicate that the - /// default number of steps should be used (i.e. ControllerMoveSteps). ControllerMoveSteps is not a compile - /// time constant, which is a requirement for default parameter values. + /// + /// The parameter defaults to a value of -1, which is a sentinel value to indicate that the + /// default number of steps should be used as specified by . + /// /// public static IEnumerator UpdateEyeGaze( Quaternion startRotation, @@ -512,9 +554,10 @@ public static IEnumerator UpdateEyeGaze( /// Moves head gaze rotation from the start rotation to the end rotation. /// /// - /// Note that numSteps defaults to a value of -1, which is a sentinel value to indicate that the - /// default number of steps should be used (i.e. ControllerMoveSteps). ControllerMoveSteps is not a compile - /// time constant, which is a requirement for default parameter values. + /// + /// The parameter defaults to a value of -1, which is a sentinel value to indicate that the + /// default number of steps should be used as specified by . + /// /// public static IEnumerator UpdateHeadGaze( Quaternion startRotation, @@ -586,7 +629,9 @@ public static int CalculateNumSteps(int numSteps) /// /// Disables gaze interactions. /// - /// This is currently done by disabling the Fuzzy Gaze Interactor GameObject. Ideally, we'd want to do this via a more system level approach + /// + /// This is currently done by disabling the component. Ideally, we'd want to do this via a more system level approach. + /// public static void DisableGazeInteractor() { GameObject.FindObjectOfType().gameObject.SetActive(false); @@ -595,7 +640,9 @@ public static void DisableGazeInteractor() /// /// Enables gaze interactions. /// - /// This is currently done by enabling the Fuzzy Gaze Interactor GameObject. Ideally, we'd want to do this via a more system level approach + /// + /// This is currently done by enabling the component. Ideally, we'd want to do this via a more system level approach. + /// public static void EnableGazeInteractor() { GameObject.FindObjectOfType().gameObject.SetActive(true); diff --git a/com.microsoft.mrtk.input/Tests/Runtime/Utilities/TestController.cs b/com.microsoft.mrtk.input/Tests/Runtime/Utilities/TestController.cs index e0a55dddff5..899fcb50bd9 100644 --- a/com.microsoft.mrtk.input/Tests/Runtime/Utilities/TestController.cs +++ b/com.microsoft.mrtk.input/Tests/Runtime/Utilities/TestController.cs @@ -62,6 +62,7 @@ public TestController(Handedness handedness) /// to use the default number of steps. For more information on this value, see /// /// + /// If true, waits a physics frame after moving the controller public abstract IEnumerator Move(Vector3 delta, int numSteps = InputTestUtilities.ControllerMoveStepsSentinelValue, bool waitForFixedUpdate = true); /// diff --git a/com.microsoft.mrtk.input/Tests/Runtime/Utilities/TestHand.cs b/com.microsoft.mrtk.input/Tests/Runtime/Utilities/TestHand.cs index 67fba2675aa..ca3377efb52 100644 --- a/com.microsoft.mrtk.input/Tests/Runtime/Utilities/TestHand.cs +++ b/com.microsoft.mrtk.input/Tests/Runtime/Utilities/TestHand.cs @@ -98,11 +98,12 @@ public override IEnumerator AimAt(Vector3 target, int numSteps = InputTestUtilit /// /// Changes the hand's pose to the given handshape. Does not animate the hand between the current pose and new pose. /// - /// The new hand pose + /// The new hand pose. + /// The new hand pose. /// If true, waits for a fixed update after moving to the new pose. - public IEnumerator SetHandshape(HandshapeId newhandshapeId, int numSteps = InputTestUtilities.ControllerMoveStepsSentinelValue, bool waitForFixedUpdate = true) + public IEnumerator SetHandshape(HandshapeId newHandshapeId, int numSteps = InputTestUtilities.ControllerMoveStepsSentinelValue, bool waitForFixedUpdate = true) { - handshapeId = newhandshapeId; + handshapeId = newHandshapeId; yield return InputTestUtilities.SetHandshape(handshapeId, handedness, numSteps); if (waitForFixedUpdate) { diff --git a/com.microsoft.mrtk.spatialmanipulation/Solvers/SolverHandler.cs b/com.microsoft.mrtk.spatialmanipulation/Solvers/SolverHandler.cs index e53df37cc15..28b2b0f6804 100644 --- a/com.microsoft.mrtk.spatialmanipulation/Solvers/SolverHandler.cs +++ b/com.microsoft.mrtk.spatialmanipulation/Solvers/SolverHandler.cs @@ -598,7 +598,7 @@ private XRBaseInteractor GetControllerInteractor(Handedness handedness) /// /// Returns true if the solver handler's transform target is not valid /// - /// true if not tracking valid hands and/or target, false otherwise + /// if not tracking valid hands and/or target, otherwise private bool IsInvalidTracking() { if (trackingTarget == null || trackingTarget.transform.parent == null) From e99497390a8ba3491d2fca1df4beb22dd0aa5d8a Mon Sep 17 00:00:00 2001 From: Adam Mollis Date: Tue, 18 Jul 2023 16:30:30 -0700 Subject: [PATCH 02/10] Addressing XML documentation warnings --- .../Assets/BuildAssets/BuildApp.cs | 4 + .../Scripts/DataSourceDictionaryTest.cs | 2 +- .../Scripts/DataSourceImageUrlTest.cs | 2 +- .../Scripts/DataSourceReflectionListTest.cs | 2 +- .../Scripts/DataSourceReflectionTest.cs | 2 +- .../Scripts/DataSourceTest.cs | 2 +- .../Assets/Scripts/GridSqueezer.cs | 4 +- .../Scripts/BatteryLevelDataSource.cs | 19 +- .../Runtime/InteractableEventRouterTests.cs | 4 +- .../TestUtilities/RuntimeTestUtilities.cs | 2 +- .../TestUtilities/SubsystemTestUtilities.cs | 6 +- .../DataConsumers/DataConsumerCollection.cs | 2 +- .../DataConsumers/DataConsumerGOBase.cs | 77 ++++--- .../DataConsumers/DataConsumerThemableBase.cs | 46 ++-- .../Scripts/DataSources/DataSourceBase.cs | 28 +-- .../Scripts/Helper/LeastRecentlyUsedCache.cs | 22 +- .../Interfaces/IDataCollectionItemPlacer.cs | 66 +++--- .../Scripts/Interfaces/IDataConsumer.cs | 43 ++-- .../Interfaces/IDataConsumerCollection.cs | 22 +- .../Runtime/Scripts/Interfaces/IDataSource.cs | 209 ++++++++++-------- .../DataCollectionItemPlacerGOBase.cs | 100 ++++++--- .../Runtime/Utilities/InputTestUtilities.cs | 24 +- .../Tests/Runtime/PressableButtonTests.cs | 2 +- .../TextToSpeech/TextToSpeechHelpers.cs | 11 +- .../Subsystems/TextToSpeechVoice.cs | 10 +- 25 files changed, 421 insertions(+), 290 deletions(-) diff --git a/UnityProjects/MRTKDevTemplate/Assets/BuildAssets/BuildApp.cs b/UnityProjects/MRTKDevTemplate/Assets/BuildAssets/BuildApp.cs index c6cd09f7720..e605c4c5e99 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/BuildAssets/BuildApp.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/BuildAssets/BuildApp.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the Apache License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System; using System.IO; using System.Linq; @@ -129,3 +132,4 @@ private static string[] SplitSceneList(string sceneList) } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceDictionaryTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceDictionaryTest.cs index 9f398bfcae0..1d5426bbf54 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceDictionaryTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceDictionaryTest.cs @@ -9,7 +9,7 @@ namespace Microsoft.MixedReality.Toolkit.Data /// Simple test data source that programmatically changes variables in a data source. /// /// - /// Using a simple store, it's possible to separate data from view + /// Using a simple key-value store, it's possible to separate data from view /// to simplify the integration of generic view prefabs that are populated from /// external information. /// diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceImageUrlTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceImageUrlTest.cs index 8767f562d97..5cc447f63fa 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceImageUrlTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceImageUrlTest.cs @@ -10,7 +10,7 @@ namespace Microsoft.MixedReality.Toolkit.Data /// its reported content, in this case an image that populates a sprite. /// /// - /// Using a simple store, it's possible to separate data from view + /// Using a simple key-value store, it's possible to separate data from view /// to simplify the integration of generic view prefabs that are populated from /// external information. /// diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionListTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionListTest.cs index 4ac25c3fe13..73c2821b7d1 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionListTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionListTest.cs @@ -10,7 +10,7 @@ namespace Microsoft.MixedReality.Toolkit.Data /// Simple test data source that programmatically changes variables in a data source. /// /// - /// Using a simple store, it's possible to separate data from view + /// Using a simple key-value store, it's possible to separate data from view /// to simplify the integration of generic view prefabs that are populated from /// external information. /// diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionTest.cs index 38f5bbc9512..f83d5de0531 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionTest.cs @@ -9,7 +9,7 @@ namespace Microsoft.MixedReality.Toolkit.Data /// Simple test data source that programmatically changes variables in a data source. /// /// - /// Using a simple store, it's possible to separate data from view + /// Using a simple key-value store, it's possible to separate data from view /// to simplify the integration of generic view prefabs that are populated from /// external information. /// diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceTest.cs index 5df39d0aa03..5d63de9f8e1 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceTest.cs @@ -9,7 +9,7 @@ namespace Microsoft.MixedReality.Toolkit.Data /// Simple test data source that programmatically changes variables in a data source. /// /// - /// Using a simple store, it's possible to separate data from view + /// Using a simple key-value store, it's possible to separate data from view /// to simplify the integration of generic view prefabs that are populated from /// external information. /// diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/GridSqueezer.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/GridSqueezer.cs index 63532db315a..6a2fb5ae3a0 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/GridSqueezer.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/GridSqueezer.cs @@ -6,13 +6,13 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Demos { - [RequireComponent(typeof(GridLayoutGroup))] - [ExecuteAlways] /// /// Demonstration script showing how to squeeze/resize /// a grid layout to fit a fixed number of columns, while /// resizing children to fit. /// + [RequireComponent(typeof(GridLayoutGroup))] + [ExecuteAlways] [AddComponentMenu("MRTK/Examples/Grid Squeezer")] public class GridSqueezer : MonoBehaviour { diff --git a/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryLevelDataSource.cs b/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryLevelDataSource.cs index a89d2674bff..e882a6e067d 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryLevelDataSource.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryLevelDataSource.cs @@ -9,18 +9,23 @@ namespace Microsoft.MixedReality.Toolkit.Data /// /// A data source that manages a battery level and provides information that can be /// used by any data consumer related to battery level. - /// + /// + /// + /// /// As the battery level and charging state change, the desired icon may change. /// This class contains the logic to take the actual reported analog charge level /// and properly calculate the correct icon. - /// + /// + /// /// The icons are retrieved from a separate data source. This allows the actual icon /// assets to be organized and managed in a theme profile along with other theme profile /// assets. - /// + /// + /// /// The information this data source makes available are managed in a dictionary with the - /// following keypaths available for data consumers: - /// + /// following key paths available for data consumers: + /// + /// /// Data Type Keypath Description /// ======================================================== /// Sprite batteryIcon The current sprite @@ -28,7 +33,7 @@ namespace Microsoft.MixedReality.Toolkit.Data /// string label Status text, usually a % of charge /// int intLevel Integral level from 0 .. # sprites - 1 /// float realLevel Analog level from 0..1 - /// + /// [Serializable] [AddComponentMenu("MRTK/Examples/Battery Level Data Source")] public class BatteryLevelDataSource : DataSourceGOBase @@ -169,7 +174,7 @@ protected string GetSpriteListKeypath() } /// - /// Calculate an integral level from 0 to < numIntegralLevels based on charging state and analogLevel. + /// Calculate an integral level from 0 to < based on charging state and . /// /// Current battery level from 0 to 1 inclusive. /// Whether it is currently in the state of being charged. diff --git a/com.microsoft.mrtk.core/Tests/Runtime/InteractableEventRouterTests.cs b/com.microsoft.mrtk.core/Tests/Runtime/InteractableEventRouterTests.cs index 9e152196f49..90b49e42545 100644 --- a/com.microsoft.mrtk.core/Tests/Runtime/InteractableEventRouterTests.cs +++ b/com.microsoft.mrtk.core/Tests/Runtime/InteractableEventRouterTests.cs @@ -37,8 +37,8 @@ public class InteractableEventRouterTests : MonoBehaviour private XRInteractionManager cachedInteractionManager = null; /// - /// A cached reference to the on the XR rig. - /// Cleared during at the end of each test. + /// A cached reference to the in the scene. + /// Cleared during at the end of each test. /// private XRInteractionManager CachedInteractionManager { diff --git a/com.microsoft.mrtk.core/Tests/TestUtilities/RuntimeTestUtilities.cs b/com.microsoft.mrtk.core/Tests/TestUtilities/RuntimeTestUtilities.cs index 57e0dfb4975..80be84a2412 100644 --- a/com.microsoft.mrtk.core/Tests/TestUtilities/RuntimeTestUtilities.cs +++ b/com.microsoft.mrtk.core/Tests/TestUtilities/RuntimeTestUtilities.cs @@ -22,7 +22,7 @@ namespace Microsoft.MixedReality.Toolkit.Core.Tests /// Utilities that are useful for all runtime tests. Mainly used for scene setup and controlling test flow. /// /// - /// Does not include utilities for input tests; see + /// Does not include utilities for input tests; see Microsoft.MixedReality.Toolkit.Input.Tests.InputTestUtilities /// for utilities for working with simulated input devices. /// public static class RuntimeTestUtilities diff --git a/com.microsoft.mrtk.core/Tests/TestUtilities/SubsystemTestUtilities.cs b/com.microsoft.mrtk.core/Tests/TestUtilities/SubsystemTestUtilities.cs index 2246b7768c6..2d829dc9671 100644 --- a/com.microsoft.mrtk.core/Tests/TestUtilities/SubsystemTestUtilities.cs +++ b/com.microsoft.mrtk.core/Tests/TestUtilities/SubsystemTestUtilities.cs @@ -39,9 +39,9 @@ public static List CreateSubsystemForTest() where TDesc } /// - /// Creates the subsystem specified by - /// and , and ensures that it can be queried - /// from . + /// Creates the subsystem specified by + /// and , and ensures that it can be queried + /// from . /// /// /// The type of the subsystem to be created. diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCollection.cs b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCollection.cs index b0dbb2dadc7..60b32616678 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCollection.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerCollection.cs @@ -158,7 +158,7 @@ protected override bool ManageChildren() /// book of contacts, and the JSON data for the data source looks like this: /// /// - /// { + /// { /// "data_result" : /// { /// "result_code" : 0, diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerGOBase.cs b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerGOBase.cs index 1d87a18f496..c6d603c5af3 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerGOBase.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerGOBase.cs @@ -14,18 +14,20 @@ namespace Microsoft.MixedReality.Toolkit.Data { /// - /// Base class for Data Consumers that must derive from a Game Object MonoBehaviour. + /// Base class for that must derive from a game object . /// - /// /// - /// This class encapsulates as much of the basic logic that is needed to serve as a Data Consumer, + /// + /// This class encapsulates as much of the basic logic that is needed to serve as a , /// without getting into the specifics that might deviate based on the types of views being /// managed. - /// - /// Although this may change in future implementations, since an IDataConsumer does not currently + /// + /// + /// Although this may change in future implementations, since an does not currently /// need to be discoverable by other game objects, this base class - /// does not attempt to proxy a full IDataConsumer interface. It does however pass through many of the - /// IDataConsumer methods to a non-Unity base class to reduce the mix of Unity and business logic. + /// does not attempt to proxy a full interface. It does however pass through many of the + /// methods to a non-Unity base class to reduce the mix of Unity and business logic. + /// /// [Serializable] public abstract class DataConsumerGOBase : MonoBehaviour, IDataConsumer @@ -33,6 +35,7 @@ public abstract class DataConsumerGOBase : MonoBehaviour, IDataConsumer [Tooltip("Data source types used to identify an appropriate data source for automatic attachment. If no type is provided, the first data source found in parents will be used.")] [SerializeField, Experimental] private string[] dataSourceTypes; + /// /// Data source types used to identify an appropriate data source for /// automatic attachment. If no type is provided, the first data source @@ -55,13 +58,13 @@ public string[] DataSourceTypes } } - [Tooltip("For items in collections, it can be useful to ignore the prefix prepended to local keypaths, such as when it is used to look up theme data in a separate DataSource.")] - [SerializeField] /// /// For items in collections, it can be useful to ignore the prefix - /// prepended to local keypaths, such as when it is used to look up - /// theme data in a separate DataSource. + /// prepended to local key paths, such as when it is used to look up + /// theme data in a separate . /// + [Tooltip("For items in collections, it can be useful to ignore the prefix prepended to local key paths, such as when it is used to look up theme data in a separate DataSource.")] + [SerializeField] protected bool ignoreKeyPathPrefix = false; [Tooltip("Specifies if this data consumer should include inactive components when managing components in child game objects.")] @@ -77,7 +80,7 @@ public string[] DataSourceTypes /// object will not change. This will use the cached types and /// component references to scan for after they are attained a first /// time. This avoids an extensive amount of in each - /// Attach(), which is super expensive especially for DataConsumerText. + /// , which is super expensive especially for DataConsumerText. /// public bool IsFixedHierarchyWillUseCachedValues => isFixedHierarchyWillUseCachedValues; @@ -136,7 +139,7 @@ public KeyPathInfo(string localKeyPath, IDataSource dataSource) protected HashSet _componentsToManage = new HashSet(); /// - /// Note that runtime changes to this will not be reflected in the serialized data for this Component. + /// Note that runtime changes to this will not be reflected in the serialized data for this component. /// public Dictionary DataSources { @@ -162,10 +165,13 @@ public IDataController DataController /// A Unity event function that is called when the script component has been enabled. /// /// + /// /// Note that this should rarely be overridden but is declared virtual for circumstances /// where this is required. If overridden, make sure to call this default behavior. - /// + /// + /// /// Any initialization should be accomplished by overriding . + /// /// public virtual void OnEnable() { @@ -302,39 +308,51 @@ protected virtual void AttachDataConsumer() /// Perform any detach logic here that is specific to this data consumer. /// /// - /// This usually frees up any resources that were established in AttachDataConsumer. + /// This usually frees up any resources that were established in . /// protected virtual void DetachDataConsumer() { } /// + /// Add variable key paths for a component. + /// + /// + /// /// For consumers that manage one or more components for modification based on data received, /// this is a convenience method that is called once per component of the specified types - /// declared in GetComponentTypes(). - /// + /// declared in . + /// + /// /// Note that if you do not manage specific components, no need to override /// this method. Instead, register keypath listeners via a different /// method specified to the need. - /// - /// The found Component to process for keypaths. + /// + /// + /// The found Component to process for key paths. protected virtual void AddVariableKeyPathsForComponent(Component component) { // No default behavior, but also not needed if not a component based binding } /// + /// Get the component types. + /// + /// + /// /// If your data consumer modifies components, particularly all components found of a - /// certain type, then declaring them here will result in AddVariableKeyPathsForComponent + /// certain type, then declaring them here will result in /// to be called for each found component in this or is specified in child objects. - /// + /// + /// /// If you do not operate on components, then no need to override this method. Instead - /// simply override InitializeDataConsumer for one-time initialization and - /// override AttachDataConsumer for any setup that should occur each time - /// your class is enabled, in which you should call AddKeyPathListener() for any keypaths + /// simply override for one-time initialization and + /// override for any setup that should occur each time + /// your class is enabled, in which you should call for any key paths /// that you want the datasource to notify of any changes. - /// - /// List of Component types. + /// + /// + /// List of component types. protected virtual Type[] GetComponentTypes() { Type[] types = Array.Empty(); @@ -352,9 +370,12 @@ protected virtual bool ManageChildren() /// - /// Allows for using GetComponentInChildren with the optional second parameter, if non-active components should be considered. - /// Defaults to only consider ACTIVE components -- Should be overridden if this behavior is not desired by data consumers. + /// Get whether or not to inactive child components should be included. /// + /// + /// Allows for using with the optional second parameter, if non-active components should be considered. + /// Defaults to only consider active components. This should be overridden if this behavior is not desired by data consumers. + /// protected virtual bool ShouldIncludeInactiveComponentsInChildren() { return includeInactiveComponentsInChildren; diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemableBase.cs b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemableBase.cs index 8131b590e0d..b86e7040977 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemableBase.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/DataConsumers/DataConsumerThemableBase.cs @@ -16,7 +16,7 @@ namespace Microsoft.MixedReality.Toolkit.Data // This helps get around issue when mixing generics, concrete classes and interfaces in the inheritance. public abstract class DataConsumerThemableBase : DataConsumerGOBase, IDataBindable { - [Tooltip("One or more data binding profiles to map data and theme keypaths to the materials they should manage.")] + [Tooltip("One or more data binding profiles to map data and theme key paths to the materials they should manage.")] [SerializeField] private DataBindingProfile[] dataBindingProfiles; public DataBindingProfile[] DataBindingProfiles @@ -54,23 +54,32 @@ protected class BindingInfo } /// - /// This class provides a way to load a resource via many different - /// potential retrieval means based on the nature of the value received - /// from the data source: - /// - /// Object of correct type provided directly - /// Numeric index lookup - /// key-value pair lookup - /// Resource path to load a Unity resource ("resource://pathToUnityResource") - /// Streaming asset path to a file that can be loaded using any appropriate means ("file://pathToUnityStreamingAsset") - /// - /// Generic type T is the type of object expected from the data source - /// Generic type U is the Component type in the scene hierarchy where that object of type T will be modified. - /// + /// This class provides a way to load a resource via many different sources. /// - - /// The type of the object expected such as Image, Material, Texture2D, Sprite, Mesh - /// The type of Component to be managed, typically a Renderer, Material, or Texture2D + /// + /// + /// The potential sources are based on the nature of the value received + /// from the data source. For example the methods of the value retrieval can be: + /// + /// + /// + /// Object of correct type provided directly + /// + /// + /// Numeric index lookup + /// + /// + /// Key-value pair lookup + /// + /// + /// Resource path to load a Unity resource; for example, "resource://pathToUnityResource" + /// + /// + /// Streaming asset path to a file that can be loaded using any appropriate means; for example, "file://pathToUnityStreamingAsset" + /// + /// + /// + /// The type of the object expected from the data source, such as Image, Material, Texture2D, Sprite, Mesh [Serializable] public abstract class DataConsumerThemableBase : DataConsumerThemableBase where T : class { @@ -149,9 +158,6 @@ protected virtual T GetObjectByThemeLookupIndex(BindingInfo binding, int n) /// /// Get a value within a binding profile using this string. /// - /// - /// Given a string key, lookup desired theme keypath to retrieve the theme value. - /// /// /// Override this method to support data sources that provide string key values /// that can be then used as a dictionary lookup of the appropriate theme diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/DataSources/DataSourceBase.cs b/com.microsoft.mrtk.data/Runtime/Scripts/DataSources/DataSourceBase.cs index e8156b02b18..234138ee1ec 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/DataSources/DataSourceBase.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/DataSources/DataSourceBase.cs @@ -12,13 +12,18 @@ namespace Microsoft.MixedReality.Toolkit.Data { /// - /// Base implementation of the IDataSource interface. This base class - /// contains no Unity specific code and can be used as the base for + /// Base implementation of the interface. + /// + /// + /// + /// This base class contains no Unity specific code and can be used as the base for /// implementing other concrete data source classes. - /// + /// + /// /// To make any data source available as a MonoBehavior, see /// DataSourceGOBase. - /// + /// + /// public class DataSourceBase : IDataSource { protected IDataKeyPathMapper _dataKeyPathMapper = null; @@ -173,7 +178,7 @@ public void AddDataConsumerListener(string resolvedKeyPath, IDataConsumer dataCo /// /// /// Note that the collection object may not actually an actual C# collection from the data source. It may - /// be an IEnumerator that can enumerate the keypaths of the collection items. + /// be an IEnumerator that can enumerate the key paths of the collection items. /// /// Fully resolved key path for the collection /// The collection being added. @@ -182,22 +187,19 @@ public virtual void OnCollectionListenerAdded(string resolvedKeyPath, object col // no default action. Override for further collection listener setup. } - /// - /// Triggered whenever a datum is removed that is a collection + /// Triggered whenever a datum is removed that is a collection. /// /// - /// Note that the collection object may not actually an actual C# collection from the data source. It may - /// be an IEnumerator that can enumerate the keypaths of the collection items. + /// Note that the collection object may not actually be a collection from the data source. It may + /// be a that can enumerate the key paths of the collection items. /// - /// Fully resolved key path for the collection - /// The collection itself that will be removed. + /// Fully resolved key path for the collection. public virtual void OnCollectionListenerRemoved(string resolvedKeyPath) { // no default action. Override for further collection listener setup. } - /// public virtual void RemoveDataConsumerListener(string resolvedKeyPath, IDataConsumer dataConsumer) { @@ -212,7 +214,7 @@ public virtual void RemoveDataConsumerListener(string resolvedKeyPath, IDataCons if (--_dataConsumerKeyPathCounts[dataConsumer] == 0) { - // all keypaths for this dataconsumer have been removed, so remove data consumer + // all key paths for this data consumer have been removed, so remove data consumer _dataConsumerKeyPathCounts.Remove(dataConsumer); } } diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Helper/LeastRecentlyUsedCache.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Helper/LeastRecentlyUsedCache.cs index 615a8f701a9..1ec7ff77761 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Helper/LeastRecentlyUsedCache.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Helper/LeastRecentlyUsedCache.cs @@ -25,7 +25,7 @@ public class LeastRecentlyUsedCache where VT : LRUValue // Makes it possible to efficiently find linked list node by index private Dictionary> _lruIndexLookup; - // Pre-allocated all nodes at initialize time to avoid allocs later. + // Pre-allocated all nodes at initialize time to avoid allocations later. private Stack> _lruNodeFreePool; private int _maxEntries = 0; @@ -64,10 +64,12 @@ public void Clear() /// /// Change the size of the cache. - /// - /// NOTE: You can only currently increase the size. /// + /// + /// NOTE: You can only currently increase the size. + /// /// The new size to make cache. + /// Whether to preallocate space to avoid cost later. public void SetSize(int newSize, bool preallocate = true) { if (preallocate) @@ -89,26 +91,30 @@ public void SetSize(int newSize, bool preallocate = true) /// - /// Add or update a value in the cache with associated key + /// Add or update a value in the cache with associated key. /// /// + /// /// The key can be used for efficient retrieval of any value, which /// then makes it the most recently used entry. - /// + /// + /// /// If the key already exists, the value is updated and it is moved /// to the most recently used (newest) slot. - /// + /// + /// /// By default it will be positioned as the newest value, but if - /// the addAsNewest argument is false, it is also possible to add it + /// the argument is , it is also possible to add it /// as the oldest (and hence first to be reused). This is useful /// for putting already allocated items back in the list instead of /// destroying them as a speculative possibility that it MAY get /// reused in the future even though you're actually done with it /// for now. + /// /// /// A key associated with the value. /// The value to add. - /// If true add as the most recently used item. If false, add as oldest item. + /// If add as the most recently used item. If , add as oldest item. public void AddOrUpdateValue(KT key, VT value, bool makeNewest = true) { if (makeNewest == true || _lruNodeFreePool.Count > 0) diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataCollectionItemPlacer.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataCollectionItemPlacer.cs index e6bdff3fae1..429238eaa4c 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataCollectionItemPlacer.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataCollectionItemPlacer.cs @@ -10,20 +10,22 @@ namespace Microsoft.MixedReality.Toolkit.Data { /// - /// Interface for placing items from a list into the gameobject hierarchy in a meaningful way. + /// Interface for placing items from a list into the game object hierarchy in a meaningful way. /// - /// /// + /// /// An object implementing this interface can be dependency injected into the DataConsumerCollection (or /// similar) Component via the Unity inspector. - /// + /// + /// /// In addition to controlling how a list is visualized, it can also be used to manage list pagination, virtualization /// and predictive prefetching. - /// + /// + /// /// When a list has changed, this object will be notified. It can then request a range of game objects to be provided for placement, /// where each game object has been modified to reflect the data associated with that entry in the list. The game object will /// typically be a prefab of arbitrary complexity. - /// + /// /// public interface IDataCollectionItemPlacer { @@ -31,53 +33,61 @@ public interface IDataCollectionItemPlacer /// Attach item placer and prepare for use /// /// - /// Item placers may be attached / detached at any time and this + /// Item placers may be attached or detached at any time and this /// is an opportunity to allocate any needed resources /// void Attach(); /// - /// Detach item placer and remove any visible items + /// Detach item placer and remove any visible items/ /// /// - /// Item placers may be attached / detached at any time and this + /// Item placers may be attached or detached at any time and this /// is where any remaining visible items should be removed and /// returned for re-use. /// void Detach(); /// - /// set the data consumer for a collection that can provide gameobjects to be placed. This will normally be set by the data consumer - /// that was assigned this placer during initialization phase. + /// Set the data consumer for a collection that can provide game objects to be placed. /// - /// + /// + /// This will normally be set by the data consumer + /// that was assigned this placer during initialization phase. + /// /// Data consumer for a collection that will provide game objects to place. void SetDataConsumerCollection(IDataConsumerCollection dataConsumerCollection); /// /// Start placement for the requested range of game objects. - /// - /// This can be used to reset any state information in preparation for receiving the new items. - /// - /// All PlaceItem() method calls will occur within StartPlacement() and EndPlacement() method calls. /// + /// + /// + /// This can be used to reset any state information in preparation for receiving the new items. + /// + /// + /// All method calls will occur within and method calls. + /// + /// void StartPlacement(); /// /// Place a game object into the experience previously requested via IDataConsumer.RequestCollectionItems() /// - /// /// - /// All calls to this method will be within a StartPlacement() and an EndPlacement() call. - /// + /// + /// All calls to this method will be within a and a call. + /// + /// /// The request id will always be the request Id provided to the IDataConsumer.RequestCollectionItems() /// method that triggered the calls to this method. This can be used to associate additional data in a /// complex scenario where there may be more than one data consumer associated with this item placer. - /// + /// + /// /// Note that the range start and range count could have been provided via state data associated with the /// requestRef, but to simplify the most common uses, it is provided explicitly. + /// /// - /// /// Any desired private object, initially provided to RequestCollectionItems() /// The absolute item index in the data source array. /// The localKeypath identifier for the item at the received index. @@ -96,8 +106,8 @@ public interface IDataCollectionItemPlacer /// This method will typically trigger a IDataConsumer.RequestCollectionItems() method call to /// request all or a subset of the items being managed in the collection. This back and forth /// allows for precise control of paging and virtualization to optimize the presentation of - /// information. - /// + /// information. + /// /// The nature of the data change, typically CollectionItemAdded, or CollectionItemRemoved. /// The keypath of the collection. /// A value relevant to the type of change. For a collection item change, this is the index of the item. @@ -139,8 +149,10 @@ public interface IDataCollectionItemPlacer /// Move visible data window by itemCount items forward or backward /// /// - /// Note if objects are not removed immediately, they must be removed later (such as after a transition effect) - /// using PurgeAllRemovableGameObjects() or PurgeRemovableGameObjectRange() + /// Note if objects are not removed immediately, they must be removed later + /// using or + /// . + /// /// THe number of items to scroll. Negative=previous. Positive=next. /// Remove no longer visible objects immediately and return back to object pool. /// Actual number of items scrolled. Note: Always positive for previous or next. @@ -150,13 +162,13 @@ public interface IDataCollectionItemPlacer /// Scroll visible data window to the specified first visible item /// /// - /// Note if objects are not removed immediately, they must be removed later (such as after a transition effect) - /// using PurgeAllRemovableGameObjects() or PurgeRemovableGameObjectRange() + /// Note if objects are not removed immediately, they must be removed later + /// using or + /// . /// /// The first visible item to navigate to. /// Purge no longer visible objects immediately and return back to object pool. /// Actual distance moved from current position. - int MoveAbsolute(int firstItem, bool purgeExitingObjectsNow = true); } } diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumer.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumer.cs index 42433d1dd0b..18804e42a66 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumer.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumer.cs @@ -22,7 +22,7 @@ namespace Microsoft.MixedReality.Toolkit.Data /// Key Concepts: /// /// - /// Key Path (string) - See IDataSource for more information. A key path identifies a specific datum in the data source. + /// Key Path (string) - See for more information. A key path identifies a specific datum in the data source. /// That datum may be a primitive, or an entire data subset. /// /// @@ -47,30 +47,40 @@ public interface IDataConsumer /// Prepare this data consumer for use and attach to the provided external resources. /// /// + /// /// The use of this method is typically associated with a prefab item in a list when it is added to a list. It is called on /// each DataConsumer in the prefab when re-using a prefab that's newly instantiated or retrieved from an object pool. - /// + /// + /// /// Multiple data sources allows data to come from several places, typically useful for binding both data and themes. - /// - /// This is typically not called from application level code or derived classes. It is public to allow DataConsumerCollection and similar + /// + /// + /// This is typically not called from application level code or derived classes. It is public to allow and similar /// aggregate consumers to attach any spawned child data consumers. - /// - /// AttachDataConsumer allows derived classes to perform additional attach tasks. + /// + /// + /// The function allows derived classes to perform additional attach tasks. + /// /// /// Which data sources to attach to for attaching a run-time loaded object, keyed to string DataType. - /// The path prefix for this object to be appended to front of all local keypaths. + /// The data controller to use during the attach process. + /// The path prefix for this object to be appended to front of all local key paths. void Attach(Dictionary dataSources, IDataController controller, string resolvedKeyPathPrefix = null); /// /// Detach this data consumer and prepare to return to object pool. /// /// + /// /// Detach from external resources before it is disabled. - /// - /// This is typically not called by application level code. It is public to allow DataConsumerCollection and similar + /// + /// + /// This is typically not called by application level code. It is public to allow and similar /// aggregate consumers to clean up any spawned child data consumers. - /// - /// AttachDataConsumer allows derived classes to perform additional detach tasks. + /// + /// + /// The function allows derived classes to perform additional detach tasks. + /// /// void Detach(); @@ -94,13 +104,14 @@ public interface IDataConsumer /// Notification of a data change. /// /// - /// For each registered keyPath, this will be called if the data at that keyPath has changed. If the keyPath represents a complex data structure, like an - /// entire collection of entries, in concept it will notify if any of that data has changed. This currently is not optimized and will be called if there is - /// a wholesale update of the dataset, but not necessarily detecting if there are actually any changes in the subset represented by this keyPath. + /// For each registered , this will be called if the data at that has changed. If the represents a complex data structure, like an + /// entire collection of entries, in concept it will notify if any of that data has changed. This currently is not optimized and will be called if there is + /// a wholesale update of the dataset, but not necessarily detecting if there are actually any changes in the subset represented by this . /// /// The data source that sent this notification. - /// The resolved keyPath for the data that has changed. - /// The value for the data represented by the keyPath and related to the type of change that occurred. + /// The resolved for the data that has changed. + /// The value for the data represented by the and related to the type of change that occurred. + /// The type of data change that has occurred. void NotifyDataChanged(IDataSource dataSource, string keyPath, object value, DataChangeType changeType); /// diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumerCollection.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumerCollection.cs index 7aa0f406b43..b569dbabd7f 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumerCollection.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataConsumerCollection.cs @@ -18,10 +18,13 @@ public interface IDataConsumerCollection : IDataConsumer /// Request specific items from an item placer for immediate use. /// /// - /// The individual items will be provided one at a time to PlaceItem() method of the calling itemPlacer. This allows data fetching and data presenting to occur - /// in a pseudo parallel fashion. - /// - /// This is used by an Item Placer to request only the subset of items in the collection that are currently relevant, usually those that are currently visible. + /// + /// The individual items will be provided one at a time to method of the calling . + /// This allows data fetching and data presenting to occur in a pseudo parallel fashion. + /// + /// + /// This is used by an item placer to request only the subset of items in the collection that are currently relevant, usually those that are currently visible. + /// /// /// The Item Placer making this request. /// The zero-based start index of the range to retrieve. @@ -33,13 +36,16 @@ public interface IDataConsumerCollection : IDataConsumer /// Request specific items from an item placer for future use. /// /// + /// /// The individual items will be cached for potential future use. - /// + /// + /// /// This is used by an Item Placer to predictively request a subset of items in the collection that may soon become visible. + /// /// /// The Item Placer making this request. - /// The zero-based start index of the range to retrieve. - /// The number of items to retrieve. If end of collection is reached, fewer items may be provided. + /// The zero-based start index of the range to retrieve. + /// The number of items to retrieve. If end of collection is reached, fewer items may be provided. void PrefetchCollectionItems(IDataCollectionItemPlacer itemPlacer, int indexRangeStart, int indexRangeCount); /// @@ -52,7 +58,7 @@ public interface IDataConsumerCollection : IDataConsumer /// Return a game object that is no longer needed for visual presentation. /// /// The index in the collection of the item to return. - /// The actual gameobject to return, usually a prefab. + /// The actual game object to return, usually a prefab. void ReturnGameObjectForReuse(int itemIndex, GameObject itemGO); } } diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataSource.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataSource.cs index ff6e801fe45..fb8c1ec2479 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataSource.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Interfaces/IDataSource.cs @@ -14,13 +14,38 @@ namespace Microsoft.MixedReality.Toolkit.Data /// public enum DataChangeType { - DatumAdded, // A new datum (of arbitrary complexity such as a collection) came into being that did not exist prior to this - // When a listener is assigned to a particular object, this event allows for initial observation of that object - DatumModified, // An existing datum has been modified - DatumRemoved, // An existing datum has been removed - CollectionReset, // A collection is reset to 0 items - CollectionItemAdded, // A new item (of arbitrary complexity) has been added to a collection - CollectionItemRemoved // An item in a list has been removed from a collection + /// + /// A new datum (of arbitrary complexity such as a collection) came into being that did not exist prior to this. + /// + /// + /// When a listener is assigned to a particular object, this event allows for initial observation of that object + /// + DatumAdded, + + /// + /// An existing datum has been modified. + /// + DatumModified, + + /// + /// An existing datum has been removed. + /// + DatumRemoved, + + /// + /// A collection is reset to 0 items. + /// + CollectionReset, + + /// + /// A new item (of arbitrary complexity) has been added to a collection. + /// + CollectionItemAdded, + + /// + /// An item in a list has been removed from a collection. + /// + CollectionItemRemoved } /// @@ -48,12 +73,12 @@ public enum DataChangeType /// which are the two most prevalent means of transferring information from back-end services. Example key paths: /// /// - /// temperature - /// contacts[10].firstName - /// contacts - /// contacts[10].addresses[3].city - /// [10].title - /// kingdom.animal.mammal.aardvark.diet.foodtypes.termites + /// temperature + /// contacts[10].firstName + /// contacts + /// contacts[10].addresses[3].city + /// [10].title + /// kingdom.animal.mammal.aardvark.diet.foodtypes.termites /// /// /// Given that a key path is an arbitrary string with no required taxonomy, the actual @@ -100,105 +125,114 @@ public interface IDataSource /// Get the data source type /// /// + /// /// The data source type is an arbitrary string type that can be used /// by data consumers to find the correct data source to listen to. - /// + /// + /// /// The value is arbitrary. In a simple use case, it can be used to differentiate /// between a "data" and a "theme" data source when theming is in use. /// In more sophisticated applications, there can be any /// variety of types to ensure data consumers can find and are attached to the correct /// data source. - /// + /// + /// /// CAUTION: Changing the type while attached to data consumers may create unintended /// behavior. The setter is provided for setting the type during initialization /// prior to attachment by data consumers. + /// /// string DataSourceType { get; set; } /// - /// An optional data controller + /// An optional data controller. /// /// - /// This data controller will be bound to any DataConsumers that are attached to this data source. + /// This data controller will be bound to any DataConsumers that are attached to this data source. + /// IDataController DataController { get; set; } /// - /// Set a keyPath mapper + /// Set a key path mapper. /// - /// /// /// If the view (data consumer) uses generic key paths that are not the same as the data source, then this /// mapper will translate between data and view key paths. This allows a generic view to be used with a wide /// variety of data sources without modification. /// - /// - /// Data keyPath mapper to assign. + /// Data key path mapper to assign. void SetDataKeyPathMapper(IDataKeyPathMapper dataKeyPathMapper); /// + /// Resolve a key path using a given prefix and local path. /// - /// /// - /// Given a resolved (data source namespace) keyPath, and a local (data consumer namespace) keypath, - /// return a fully resolved data source keyPath for that data item. - /// + /// + /// Given a resolved (data source namespace) key path, and a local (data consumer namespace) keypath, + /// return a fully resolved data source key path for that data item. + /// + /// /// This can be an empty string if the represents an /// absolute location in the data set. If the is a member of one item in /// an array of items, then the prefix will be that of the data container itself containing - /// the array - /// + /// the array. + /// + /// /// If the specified item can not be found in the data source, null is returned. + /// /// - /// /// The data path prefix. /// The local keyPat to resolve. Note that this may be mapped by a - /// /// A string that can be used to map to a view data consumer. string ResolveKeyPath(string resolvedKeyPathPrefix, string localKeyPath); /// - /// Get the value associated with the specified keyPath and prefix + /// Get the value associated with the specified key path and prefix /// - /// /// + /// /// The returned value can be of any arbitrary complexity or data type from primitives to complex nesting of /// dictionaries and arrays, to image or audio data. - /// + /// + /// /// The fullyQualifiedPrefix is provided for lists (or collection of lists) to find the correct instance of a specific local keypath. /// If not processing a collection, this can be either null or "". It is considered fully qualified because it has been resolved - /// to the namespaces of the data source where each sub-component may have been mapped from a view keyPath to a data keyPath. - /// This means that the path may not be recognizable on casual observation relative to the keyPath variables + /// to the namespaces of the data source where each sub-component may have been mapped from a view key path to a data key path. + /// This means that the path may not be recognizable on casual observation relative to the key path variables /// embedded in views and sub-views. - /// - /// Note that a keyPath for a collection is useful for regenerating an entire collection. If the object is a collection, + /// + /// + /// Note that a key path for a collection is useful for regenerating an entire collection. If the object is a collection, /// returns an that can be used to enumerate the key paths of all children in the collection. - /// + /// /// - /// /// Prefix for a collection /// object of arbitrary data type or complexity, but will most often be a primitive type. object GetValue(string resolvedKeyPath); /// - /// Set the value associated with the specified keyPath + /// Set the value associated with the specified key path /// - /// /// + /// /// CAUTION: If isAtomicChange is omitted or passed as false, there MUST be a DataChangeSetBegin() and DataChangeSetEnd() method /// calls bracketing this. If not done, certain DataConsumers that only process as a batch (like TMPro) will not update /// the presented information. - /// + /// + /// /// This is currently useful when the data embedding is being used for local, realtime changes of presented information. - /// - /// The fullyQualifiedPrefix is provided for lists (or collection of lists) to find the correct instance of a specific local keypath. + /// + /// + /// The fullyQualifiedPrefix is provided for lists (or collection of lists) to find the correct instance of a specific local key path. /// If not processing a collection, this can be either null or "". It is considered fully qualified because it has been resolved - /// to the namespaces of the data source where each sub-component may have been mapped from a view keyPath to a data keyPath. - /// This means that the path may not be recognizable on casual observation relative to the keyPath variables + /// to the namespaces of the data source where each sub-component may have been mapped from a view key path to a data key path. + /// This means that the path may not be recognizable on casual observation relative to the key path variables /// embedded in views and sub-views. - /// + /// + /// /// Although not fully implemented yet, it could also be used to persist changes to a back-end data store of some kind, /// such as might be useful for a data entry form. - /// + /// /// /// The fully resolved key path for the variable to change. /// The new value to set at that key path. @@ -206,90 +240,75 @@ public interface IDataSource void SetValue(string resolvedKeyPath, object value, bool isAtomicChange = false); /// - /// Add a new data consumer listener for the specified keyPath + /// Add a new data consumer listener for the specified key path /// - /// /// - /// Specify a listener for any particular keyPath, such as when the data represented by that keyPath changes, + /// Specify a listener for , such as when the data represented by changes, /// the NotifyDataChanged() method of the IDataConsumer will be called. /// - /// - /// The keyPath for the data to monitor for changes. + /// The key path for the data to monitor for changes. /// The data consumer that is to be notified. void AddDataConsumerListener(string resolvedKeyPath, IDataConsumer dataConsumer); /// - /// Remove a data consumer listener for the specified keyPath + /// Remove a data consumer listener for the specified key path /// - /// /// - /// Remove a previously added listener for the specified keyPath such that no + /// Remove a previously added listener for the specified such that no /// further notifications will be provided. Note that this will not impact /// other data consumers that may have also registered listeners. /// - /// - /// The keyPath to stop monitoring. - /// The data consumer to remove for that keyPath. + /// The key path to stop monitoring. + /// The data consumer to remove for that key path. void RemoveDataConsumerListener(string resolvedKeyPath, IDataConsumer dataConsumer); /// - /// Determine if keyPath represents a data collection + /// Determine if key path represents a data collection /// - /// /// - /// When a data consumer is notified of a data change at the specified keyPath, this + /// When a data consumer is notified of a data change at the specified , this /// can be used to determine if that object represents a collection. The collection can /// be of any type that can be accessed reliably via an index value. This is useful for /// auto-generating and presenting a collection that contains variable data, /// like a collection of users, or playlists. /// - /// - /// The keyPath of data to be checked. - /// The data consumer to remove for that keyPath. - /// - /// boolean indication of whether that keyPath represents a collection. + /// The key path of data to be checked. + /// A Boolean indication of whether that represents a collection. bool IsCollectionAtKeyPath(string resolvedKeyPath); /// - /// If a keyPath represents a collection, return the number of items in that collection. + /// If a key path represents a collection, return the number of items in that collection. /// - /// /// /// This can be used by a data consumer to pre-allocate resources to receive the /// collection, and also to determine the valid index range of 0 to N-1 when using /// GetNthCollectionKayPathAt() to retrieve entries in the collection. /// - /// - /// The keyPath of data to be checked. - /// + /// The key path of data to be checked. /// integer size of the collection. An empty collection is valid. int GetCollectionCount(string resolvedKeyPath); /// - /// If a keyPath represents a collection, return the nth entry of that collection. + /// If a key path represents a collection, return a collection key path for the entry at index . /// - /// /// /// The returned entry can be of arbitrary type and complexity and may even itself contain /// collections. /// - /// - /// The keyPath of the collection itself. - /// - /// The fully resolved keypath for the nth item in a collection. + /// The key path of the collection itself. + /// Get the key path for the entry at this index. + /// The fully resolved key path for the nth item in a collection. string GetNthCollectionKeyPathAt(string resolvedKeyPath, int n); /// - /// Get an enumerable collection of keyPath strings for the specified collection index range. + /// Get an enumerable collection of key path strings for the specified collection index range. /// - /// /// /// This is useful for list virtualization where you only fetch the sub-portion of the list that is /// currently visible. /// - /// - /// The keyPath of the collection itself. + /// The key path of the collection itself. /// The index of the first element of the desired range. /// The number of entries to return, (or fewer if end of collection is reached). /// A string enumerable for all the fully resolved key paths in the specified range. @@ -298,40 +317,42 @@ public interface IDataSource /// /// Begin a data change set. /// - /// /// - /// + /// /// The default behavior is to notify all registered data consumers that a change set has begun. - /// + /// + /// /// This is mainly exposed in this interface to allow for nested data sets where a /// super data set has child data sets with unknown concrete implementations, and /// wants to synchronize set boundaries. + /// /// void DataChangeSetBegin(); /// /// End a data change set. /// - /// /// + /// /// The default behavior is to notify all registered data consumers that a change set has begun. - /// + /// + /// /// This is mainly exposed in this interface to allow for nested data sets where a /// super data set has child data sets with unknown concrete implementations, and /// wants to synchronize set boundaries. + /// /// void DataChangeSetEnd(); /// - /// Inform data source that its data has changed + /// Inform data source that its data has changed. /// /// /// This is used in situations where is not being used to modify /// the managed data, and the data source is not otherwise aware that the data /// has changed. This directly propagates the notification to all data consumers - /// who are listening for this specific keyPath. + /// who are listening for this specific key path. /// - /// /// The resolved keypath of the data that has changed. /// The value of the changed item /// The type of change that has occurred. @@ -348,12 +369,12 @@ public interface IDataSource /// is when initially populating a static dataset before notifying data consumers of the availability of data. For example: /// /// - /// SetValue( keypath1, value1 ); + /// SetValue( keypath1, value1 ); /// ... - /// SetValue( keypathn, valuen ); - /// DataChangeSetBegin(); - /// NotifyAllChanged(); - /// DataChangeSetEnd(); + /// SetValue( keypathn, valuen ); + /// DataChangeSetBegin(); + /// NotifyAllChanged(); + /// DataChangeSetEnd(); /// /// /// Note that this currently will be less efficient than triggering changes on individual data items as they occur. diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/ItemPlacers/DataCollectionItemPlacerGOBase.cs b/com.microsoft.mrtk.data/Runtime/Scripts/ItemPlacers/DataCollectionItemPlacerGOBase.cs index 4f44cc85b02..b6a8341e7d0 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/ItemPlacers/DataCollectionItemPlacerGOBase.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/ItemPlacers/DataCollectionItemPlacerGOBase.cs @@ -13,17 +13,21 @@ namespace Microsoft.MixedReality.Toolkit.Data { /// /// A data collection item placer base implementation that supports paging. - /// + /// + /// + /// /// This is a base object that can be derived from to support more complex scenarios. - /// + /// + /// /// A typical item placer will populate a UX element designed to present lists or grids of /// items, and typically also supports paging and/or scrolling for larger lists. - /// - /// TODO: Make a simpler GO base class that is used in DataConsumerCollection so that it is not - /// assumed what functionality may be desired in an item placer. - /// + /// + /// public abstract class DataCollectionItemPlacerGOBase : MonoBehaviour, IDataCollectionItemPlacer { + // TODO: Make a simpler GO base class that is used in DataConsumerCollection so that it is not + // assumed what functionality may be desired in an item placer. + [Tooltip("(Optional) Private request reference or ID that is provided with every request for collection items to correlate the PlaceItem calls to the original request.")] [SerializeField, Experimental] protected string requestRef = ""; @@ -71,11 +75,30 @@ public abstract class DataCollectionItemPlacerGOBase : MonoBehaviour, IDataColle protected enum State { - Requested = 0, // Requested but not yet received - Visible, // Currently visible - Prefetched, // Prefetched but not yet visible - Removable, // Removable - StashRemovable // Temporarily stash removables that are still being fetched + /// + /// Requested but not yet received. + /// + Requested = 0, + + /// + /// Currently visible. + /// + Visible, + + /// + /// Prefetched but not yet visible. + /// + Prefetched, + + /// + /// Removable + /// + Removable, + + /// + /// Temporarily stash removable entries that are still being fetched. + /// + StashRemovable } protected class ItemInfo @@ -101,8 +124,8 @@ public ItemInfo(int index, State theState, string keyPath, GameObject go) /// Item placer is going into attached state either after initialization or after being dormant in game object pool. /// /// - /// NOTE: if derived class needs to do more Attach readiness logic, this can be done - /// by overriding AttachItemPlacer + /// NOTE: if derived class needs to do more readiness logic, this can be done + /// by overriding . /// public void Attach() { @@ -136,8 +159,8 @@ public void Attach() /// Item placer is going into detached state either before returning in game object pool or destroy /// /// - /// NOTE: if derived class needs to do more Detach readiness logic, this can be done - /// by overriding AttachItemPlacer + /// NOTE: if derived class needs to do more readiness logic, this can be done + /// by overriding . /// public void Detach() { @@ -150,19 +173,17 @@ public void Detach() } /// - /// Perform additional attach prep in derived class + /// Perform additional attach prep in derived class. /// protected virtual void AttachItemPlacer() { - } /// - /// Perform additional detach teardown in derived class + /// Perform additional detach teardown in derived class. /// protected virtual void DetachItemPlacer() { - } protected void CheckForEventsToTrigger() @@ -313,7 +334,7 @@ protected void ChangeItemState(int indexAsId, State newState) /// /// Can be called for debug purposes to ensure the state is always consistent - /// between _itemStateByIndex and _ItemsByState + /// between and . /// private void DebugCheckStateIntegrity() { @@ -402,15 +423,19 @@ protected void PurgeAllVisibleAndRemovableItems() /// Purge all game objects that have been queued for removal. /// /// + /// /// Normally items are removed as soon as they have been scrolled out of visibility, but /// to allow for transition effects, that default behavior for all scroll related methods /// can be delayed and the items can be manually purged with this method. - /// + /// + /// /// NOTE: if objects are not purged, they will indefinitely be referenced by this item placer, /// creating an effective memory leak. - /// + /// + /// /// This is useful for purging all previously visible items, such as /// after a transition effect, such as fade out, is done. + /// /// public void PurgeAllRemovableGameObjects() { @@ -440,15 +465,19 @@ public void PurgeAllRemovableGameObjects() /// Purge a range of game objects that have been queued for removal. /// /// + /// /// Normally items are removed as soon as they have been scrolled out of visibility, but /// to allow for transition effects, that default behavior for all scroll related methods /// can be delayed and the items can be manually purged with this method. - /// + /// + /// /// NOTE: if objects are not purged, they will indefinitely be referenced by this item placer, /// creating an effective memory leak. - /// + /// + /// /// This is useful for purging a series of previously visible items, such as /// after a transition effect, such as fade out, is done. + /// /// /// Index into collection of first item to purge. /// Number of items to purge. @@ -475,9 +504,9 @@ public void PurgeRemovableGameObjectRange(int firstItemIdx, int itemCount) } /// - /// Makes copy if keys to allow modification of the dictionary during iteration + /// Makes copy if keys to allow modification of the dictionary during iteration. /// - /// one of the state item dicts. + /// one of the state item dictionaries. /// An array containing copies of ItemInfo objects, or null if zero entries to avoid alloc. private ItemInfo[] GetCopyOfStateItems(Dictionary stateItems) { @@ -521,9 +550,9 @@ protected bool StashOrReturnItem(ItemInfo itemInfo) } /// - /// Set the Data Consumer that is providing items for this item placer. + /// Set the data consumer collection that is providing items for this item placer. /// - /// Release objects going out of visibility back to object pool immediately. + /// Release objects going out of visibility back to object pool immediately. /// Actual number of items scrolled. public void SetDataConsumerCollection(IDataConsumerCollection dataConsumerCollection) { @@ -582,8 +611,8 @@ public void MoveToPreviousItem() /// Scroll visible data window to the specified first visible item /// /// - /// Note if objects are not removed immediately, they must be removed later (such as after a transition effect) - /// using PurgeAllRemovableGameObjects() or PurgeRemovableGameObjectRange() + /// Note, if objects are not removed immediately, they must be removed later (such as after a transition effect) + /// using or /// /// The first visible item to navigate to. /// Purge no longer visible objects immediately and return back to object pool. @@ -597,12 +626,12 @@ public int MoveAbsolute(int firstItem, bool purgeExitingObjectsNow = true) /// Scroll visible data window by itemCount items forward or backward /// /// - /// Note if objects are not removed immediately, they must be removed later (such as after a transition effect) - /// using PurgeAllRemovableGameObjects() or PurgeRemovableGameObjectRange() + /// Note, if objects are not removed immediately, they must be removed later (such as after a transition effect) + /// using or . /// /// THe number of items to scroll. Negative=previous. Positive=next. /// Purge no longer visible objects immediately and return back to object pool. - /// Actual number of items scrolled. Note: Always positive for previous or next. + /// Actual number of items scrolled. This must always be positive for previous or next. public int MoveRelative(int itemCount, bool purgeExitingObjectsNow = true) { int actualScrollAmount; @@ -1212,11 +1241,10 @@ protected virtual int GetMaxVisibleItemCount() } /// - /// Search through game object hierarchy for the nearest IDataCollectionEvents implementation. + /// Search through game object hierarchy for the nearest implementation. /// - /// /// - /// This protected method is unique to collection related Data Consumers. A CollectionEvents is used to + /// This protected method is unique to collection related data consumers. A is used to /// notify other systems that various changes in the state have occurred. This is useful for /// changing the state of paging and scrolling UX elements and for triggering transition effects. /// diff --git a/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs b/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs index 178911dd59e..b30b6c3a3f2 100644 --- a/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs +++ b/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs @@ -32,7 +32,7 @@ public class InputTestUtilities /// /// The default number of frames that elapse when in slow test controller mode. - /// See UseSlowTestController for more information. + /// See for more information. /// private const int ControllerMoveStepsSlow = 60; @@ -45,19 +45,21 @@ public class InputTestUtilities /// /// /// - /// [UnityTest] - /// public IEnumerator YourTestCase() - /// { - /// RuntimeInputTestUtils.UseSlowTestController = true; - /// ... - /// RuntimeInputTestUtils.UseSlowTestController = false; - /// } + /// [UnityTest] + /// public IEnumerator YourTestCase() + /// { + /// RuntimeInputTestUtils.UseSlowTestController = true; + /// ... + /// RuntimeInputTestUtils.UseSlowTestController = false; + /// } /// /// /// - /// Note that this value is reset to false after each play mode test that uses - /// PlayModeTestUtilities.Setup() - this is to reduce the chance that a forgotten - /// UseSlowTestController = true ends up slowing all subsequent tests. + /// + /// Note that this value is reset to after each play mode test that uses + /// , this is to reduce the chance that a forgotten + /// value for ends up slowing all subsequent tests. + /// /// public static bool UseSlowTestController { get; set; } = false; diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs index 816dde47334..65a97ebcbbf 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs @@ -768,7 +768,7 @@ public IEnumerator TriggerButtonFarInteractionWithMotionController([ValueSource( }); // Switch to motion controller - var iss = PlayModeTestUtilities.GetInputSimulationService(); + var iss = PlayModeTestUtilities.GetInputSimulationService(); var oldHandSimMode = iss.ControllerSimulationMode; iss.ControllerSimulationMode = ControllerSimulationMode.MotionController; TestMotionController motionController = new TestMotionController(Handedness.Right); diff --git a/com.microsoft.mrtk.windowsspeech/Subsystems/TextToSpeech/TextToSpeechHelpers.cs b/com.microsoft.mrtk.windowsspeech/Subsystems/TextToSpeech/TextToSpeechHelpers.cs index 9c25ed6665d..a20ca200e01 100644 --- a/com.microsoft.mrtk.windowsspeech/Subsystems/TextToSpeech/TextToSpeechHelpers.cs +++ b/com.microsoft.mrtk.windowsspeech/Subsystems/TextToSpeech/TextToSpeechHelpers.cs @@ -11,13 +11,14 @@ namespace Microsoft.MixedReality.Toolkit.Speech.Windows internal static class TextToSpeechHelpers { /// - /// Attempts to convert the provided wave data from an array of bytes to an array of floats, + /// Attempts to convert the provided wave data from a array to a array, /// in the range of -1 to 1. /// /// The audio data, including the wave header, formatted as an array of bytes. - /// The number of audio samples per channel in the array. - /// The sample rate (ex: 44.1 kHz) of the audio data. + /// The number of audio samples per channel in the array. + /// The number of samples per second for the audio data; for example, 44100 Hz. /// The resulting audio data, formatted as float values from -1 to 1. + /// The number of channels in the audio data /// if the conversion is successful, or . public static bool TryConvertWaveData( byte[] waveBytes, @@ -111,9 +112,9 @@ public static bool TryConvertWaveData( /// /// The name to give to the clip. /// The audio data which will be contained within the clip. - /// The number of audio samples per channel in the array. + /// The number of audio samples per channel in the array. /// The number of audio channels, typically 1 (mono) or 2 (stereo). - /// The frequency rate (ex: 44100 Hz) of the audio data. + /// The frequency rate of the audio data; for example, 44100 Hz. /// A Unity AudioClip object containing the provided sound data. public static AudioClip CreateAudioClip( string clipName, diff --git a/com.microsoft.mrtk.windowsspeech/Subsystems/TextToSpeechVoice.cs b/com.microsoft.mrtk.windowsspeech/Subsystems/TextToSpeechVoice.cs index a6f54a7a50a..0443936b79c 100644 --- a/com.microsoft.mrtk.windowsspeech/Subsystems/TextToSpeechVoice.cs +++ b/com.microsoft.mrtk.windowsspeech/Subsystems/TextToSpeechVoice.cs @@ -4,8 +4,11 @@ namespace Microsoft.MixedReality.Toolkit.Speech.Windows { /// - /// The en-US voices that can be used by . Voices for all other locales are categorized as Other. + /// The en-US voices that can be used by . /// + /// + /// Voices for all other locales are categorized as . + /// public enum TextToSpeechVoice { /// @@ -29,8 +32,11 @@ public enum TextToSpeechVoice Zira, /// - /// Voice not listed above (for non en-US languages) + /// Voice not listed above. /// + /// + /// For use with languages which are not en-US. + /// Other } } From ee2b46ce3ca5c97246cbd99c71de101eb21fa48c Mon Sep 17 00:00:00 2001 From: Adam Mollis Date: Wed, 19 Jul 2023 00:31:03 -0700 Subject: [PATCH 03/10] Fixing summary xml documentation. --- .../Scripts/DataControllerTest.cs | 8 +- .../Scripts/DataSourceDictionaryTest.cs | 4 + .../Scripts/DataSourceDynamicList.cs | 8 +- .../Scripts/DataSourceImageUrlTest.cs | 4 + .../Scripts/DataSourceJsonTest.cs | 11 ++- .../Scripts/DataSourceJsonThemeTest.cs | 18 ++-- .../Scripts/DataSourceReflectionListTest.cs | 4 + .../Scripts/DataSourceReflectionTest.cs | 4 + .../Scripts/DataSourceTest.cs | 4 + .../Scripts/DataSourceThemeTest.cs | 6 +- .../Scripts/ThemeProfile.cs | 4 + .../Scripts/ThemeSetter.cs | 4 + .../Assets/Scripts/AdjustLabelPosition.cs | 11 ++- .../Assets/Scripts/BandPassFilterSelection.cs | 4 + .../Assets/Scripts/ColorChanger.cs | 9 +- .../Assets/Scripts/DialogExample.cs | 6 +- .../Assets/Scripts/DictationHandler.cs | 6 +- .../Assets/Scripts/EyeCalibrationWarning.cs | 4 + .../Assets/Scripts/GridSqueezer.cs | 6 +- .../Assets/Scripts/InspectorDrivenDialog.cs | 4 + .../Assets/Scripts/ObjectSpinner.cs | 6 +- .../Assets/Scripts/PenInteractor.cs | 25 ++++-- .../Assets/Scripts/PerfSceneManager.cs | 8 +- .../Assets/Scripts/SampleSceneHandMenu.cs | 4 + .../Assets/Scripts/ScrollRectCurve.cs | 29 ++++--- .../Assets/Scripts/SystemKeyboardExample.cs | 10 ++- .../Assets/Scripts/TetheredPlacement.cs | 10 ++- .../Scripts/ToggleCollectionColorChange.cs | 6 +- .../Scripts/ToggleCollectionObjectActivate.cs | 4 + .../VirtualizedScrollRectListTester.cs | 25 ++++-- .../Assets/Scripts/Whiteboard.cs | 4 + .../Scripts/BatteryInformationProfile.cs | 4 + .../Scripts/BatteryLevelDataSource.cs | 50 ++++++++--- .../Effects/AudioBandPassFilter.cs | 8 +- .../Effects/AudioInfluencerController.cs | 54 ++++++++---- .../UXBindingProfileTemplate.cs | 2 +- .../Utilities/ControllerLookup.cs | 2 +- .../DataSources/DataSourceGODictionary.cs | 2 +- .../Helper/DataSourceProviderSingleton.cs | 2 +- .../Runtime/Scripts/Helper/ThemeSelector.cs | 2 +- .../InteractionModeManager.cs | 2 +- .../InteractorVisuals/MRTKLineVisual.cs | 2 +- .../BoundsControl/ScaleHandleInteractable.cs | 2 +- .../ObjectManipulator/ObjectManipulator.cs | 2 +- .../ControlThemes/ButtonTheme.cs | 77 ++++++++++++++--- .../ControlThemes/CommonTheme.cs | 13 ++- .../ControlThemes/DialogTheme.cs | 21 +++-- .../ControlThemes/HandMenuTheme.cs | 19 ++-- .../ControlThemes/ListMenuTheme.cs | 19 ++-- .../ControlThemes/ObjectBarTheme.cs | 6 +- .../ControlThemes/SlateTheme.cs | 6 +- .../ControlThemes/SliderTheme.cs | 6 +- .../ControlThemes/ToggleTheme.cs | 6 +- .../ProfileTemplates/UXThemeProfile.cs | 86 ++++++++++++++----- .../Button/PressableButton.cs | 2 +- .../Dialog/DialogPool.cs | 2 +- .../List/VirtualizedScrollRectList.cs | 2 +- .../NonNativeKeyboard/NonNativeValueKey.cs | 2 +- .../FontIcons/FontIconSelector.cs | 2 +- .../Interop/UGUIInputAdapter.cs | 2 +- .../LegacyDialog/DialogButton.cs | 2 +- com.microsoft.mrtk.uxcore/Slider/Slider.cs | 2 +- .../StateVisualizer/StateVisualizer.cs | 2 +- .../Toggle/ToggleCollection.cs | 2 +- 64 files changed, 506 insertions(+), 167 deletions(-) diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataControllerTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataControllerTest.cs index a09d72d44c6..af2cdeb8d0e 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataControllerTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataControllerTest.cs @@ -1,5 +1,8 @@ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +// Licensed under the MIT License. + +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 using System.Collections.Generic; using UnityEngine; @@ -7,7 +10,7 @@ namespace Microsoft.MixedReality.Toolkit.Data { /// - /// Test DataController that logs a message event to the console + /// Test that logs a message event to the console. /// [AddComponentMenu("MRTK/Examples/Data Binding/Data Controller Test")] public class DataControllerTest : DataControllerGOBase @@ -68,3 +71,4 @@ public override void ProcessCommand(string command, object data, Dictionary /// Simple data source that generates a large list of randomly generated entries. - /// This can be used to test paging and virtualization. /// + /// + /// This can be used to test paging and virtualization. + /// [AddComponentMenu("MRTK/Examples/Data Binding/Data Source Dynamic List")] public class DataSourceDynamicList : DataSourceGOBase { @@ -128,3 +133,4 @@ protected void InitializeDataSourceStatic() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceImageUrlTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceImageUrlTest.cs index 5cc447f63fa..57187defff6 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceImageUrlTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceImageUrlTest.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Data @@ -59,3 +62,4 @@ private void Update() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonTest.cs index db5d9b9928f..87cbd56500d 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonTest.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Data { /// - /// A simple data source that fetches JSON data from a specified URL every N seconds. - /// + /// A simple data source that fetches JSON data from a specified URL at a specified rate. + /// + /// /// This will trigger notification changes by the base class once the data has been /// parsed. - /// + /// [AddComponentMenu("MRTK/Examples/Data Binding/Data Source Json Test")] public class DataSourceJsonTest : DataSourceGOJson { @@ -45,3 +49,4 @@ private void Update() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonThemeTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonThemeTest.cs index 809eb708ace..593869078d1 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonThemeTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonThemeTest.cs @@ -1,19 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System; using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Data { /// - /// A simple data source that fetches JSON data from a specified URL every N seconds. - /// + /// A simple data source that fetches JSON data from a specified URL at a specified rate. + /// + /// + /// /// This will trigger notification changes by the base class once the data has been /// parsed. - /// - /// Note: The theme can be changed by pressing theme buttons at http://TryMRTK.com - /// + /// + /// + /// Note: The theme can be changed by pressing theme buttons at http://TryMRTK.com. + /// + /// [AddComponentMenu("MRTK/Examples/Data Binding/Data Source Json Theme Test")] public class DataSourceJsonThemeTest : DataSourceGOJson { @@ -63,3 +70,4 @@ private void Update() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionListTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionListTest.cs index 73c2821b7d1..138c6d444ed 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionListTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionListTest.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System.Collections.ObjectModel; using UnityEngine; @@ -200,3 +203,4 @@ protected void Randomize(string[] items) } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionTest.cs index f83d5de0531..ab3d922d85b 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceReflectionTest.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Data @@ -49,3 +52,4 @@ public override IDataSource AllocateDataSource() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceTest.cs index 5d63de9f8e1..6e66ed8653d 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceTest.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Data @@ -117,3 +120,4 @@ private void InitializeData() } } } +#pragma warning restore CS1591 diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceThemeTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceThemeTest.cs index 111c6ff453c..e8525fd445c 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceThemeTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceThemeTest.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System; using UnityEngine; @@ -49,7 +52,7 @@ public void NextTheme() } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { @@ -86,3 +89,4 @@ public override IDataSource AllocateDataSource() } } } +#pragma warning restore CS1591 diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/ThemeProfile.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/ThemeProfile.cs index 7c120b00ed2..93e5b08a8de 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/ThemeProfile.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/ThemeProfile.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System; using UnityEngine; using UnityEngine.Serialization; @@ -203,3 +206,4 @@ public SlateParameters SlateStyle } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/ThemeSetter.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/ThemeSetter.cs index 0135f63e668..c0f57c42dcd 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/ThemeSetter.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/ThemeSetter.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Data @@ -57,3 +60,4 @@ public void UpdateThemeName() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/AdjustLabelPosition.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/AdjustLabelPosition.cs index 0d23d6fc5cb..dacc7a61ac4 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/AdjustLabelPosition.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/AdjustLabelPosition.cs @@ -1,14 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Examples.Demos { /// - /// Script to adjust the position of this GameObject when another GameObject resizes. - /// Used to position see-it say-it labels when non-canvas button backplate resizes. + /// Script to adjust the position of this when another + /// resizes. /// + /// + /// Used to position see-it say-it labels when non-canvas button backplate resizes. + /// public class AdjustLabelPosition : MonoBehaviour { [SerializeField] @@ -26,3 +32,4 @@ protected virtual void Awake() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/BandPassFilterSelection.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/BandPassFilterSelection.cs index 3cf427c4e75..6837a636044 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/BandPassFilterSelection.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/BandPassFilterSelection.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System.Collections.Generic; using Microsoft.MixedReality.Toolkit.Audio; using TMPro; @@ -37,3 +40,4 @@ public void SetFilter(int index) } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/ColorChanger.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/ColorChanger.cs index 548abfca6c7..732c10fe100 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/ColorChanger.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/ColorChanger.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Examples.Demos { /// - /// Change the color of the material on a renderer. Useful for visualizing button presses. + /// Change the color of the material on a renderer. /// + /// + /// This is useful for visualizing button presses. + /// [AddComponentMenu("MRTK/Examples/Color Changer")] public class ColorChanger : MonoBehaviour { @@ -69,3 +75,4 @@ public void RandomColor() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/DialogExample.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/DialogExample.cs index 78870d46a40..ba4511e5f13 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/DialogExample.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/DialogExample.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using UnityEngine; using Microsoft.MixedReality.Toolkit.UX; @@ -72,4 +75,5 @@ private async void ShowAsyncDialog() Debug.Log("Async dialog says " + result.Choice?.ButtonText); } } -} \ No newline at end of file +} +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/DictationHandler.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/DictationHandler.cs index dde191e43f5..a8367cdf771 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/DictationHandler.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/DictationHandler.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using Microsoft.MixedReality.Toolkit.Subsystems; using UnityEngine; using UnityEngine.Events; @@ -9,7 +12,7 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Demos { /// /// Demonstration script showing how to subscribe to and handle - /// events fired by DictationSubsystem. + /// events fired by . /// [AddComponentMenu("MRTK/Examples/Dictation Handler")] public class DictationHandler : MonoBehaviour @@ -130,3 +133,4 @@ public void HandleDictationShutdown() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/EyeCalibrationWarning.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/EyeCalibrationWarning.cs index 87f12d78078..eec5da23d2c 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/EyeCalibrationWarning.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/EyeCalibrationWarning.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using UnityEngine; using UnityEngine.Events; using Microsoft.MixedReality.Toolkit.Input; @@ -93,3 +96,4 @@ private void UpdateMessage(EyeCalibrationStatus status) } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/GridSqueezer.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/GridSqueezer.cs index 6a2fb5ae3a0..39ed1b2565c 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/GridSqueezer.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/GridSqueezer.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using UnityEngine; using UnityEngine.UI; namespace Microsoft.MixedReality.Toolkit.Examples.Demos { /// - /// Demonstration script showing how to squeeze/resize + /// Demonstration script showing how to squeeze or resize /// a grid layout to fit a fixed number of columns, while /// resizing children to fit. /// @@ -84,3 +87,4 @@ private void Update() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/InspectorDrivenDialog.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/InspectorDrivenDialog.cs index 9c0c51cec5d..4d9bc4e0024 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/InspectorDrivenDialog.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/InspectorDrivenDialog.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using Microsoft.MixedReality.Toolkit.UX; @@ -77,3 +80,4 @@ public void Show() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/ObjectSpinner.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/ObjectSpinner.cs index d84fc639340..3d88eca3408 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/ObjectSpinner.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/ObjectSpinner.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using UnityEngine; using Microsoft.MixedReality.Toolkit.UX; namespace Microsoft.MixedReality.Toolkit.Examples.Demos { /// - /// Spins object on events + /// Spins object on events. /// [AddComponentMenu("MRTK/Examples/Object Spinner")] public class ObjectSpinner : MonoBehaviour @@ -69,3 +72,4 @@ public void Update() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/PenInteractor.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/PenInteractor.cs index 474ee819afd..4497b65ec7b 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/PenInteractor.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/PenInteractor.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System; using System.Collections.Generic; using Unity.Profiling; @@ -13,17 +16,22 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Demos { /// - /// A simple interactor that can live on inanimate/non-XRController objects. - /// Acts as a poking interactor through trigger intersections. + /// A simple interactor that can live on inanimate or on objects that + /// do not contain a . /// /// - /// The full PokeInteractor implementation used for the user's fingers - /// uses a much more advanced spherecast intersection system to ensure that + /// + /// This interactor acts as a poking interactor through trigger intersections. + /// + /// + /// The full implementation used for the user's fingers + /// uses a much more advanced sphere cast intersection system to ensure that /// high speed pokes are always registered. This interactor, however, uses /// simple trigger intersections in the interest of simplicity and demonstration. - /// At high speeds (and low framerates) this may "miss" some intersections with - /// interactables. For higher fidelity intersections, consider using a spherecast - /// system like PokeInteractor. + /// At high speeds, and low frame rates, this may miss some intersections with + /// interactables. For higher fidelity intersections, consider using a sphere cast + /// system like . + /// /// [AddComponentMenu("MRTK/Examples/Pen Interactor")] internal class PenInteractor : XRBaseInteractor, IPokeInteractor @@ -72,7 +80,7 @@ public override void ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase upda { // Update the trajectory. // The PokeInteractor we use for hands does advanced - // spherecasting to ensure reliable pokes; as a demonstration, + // sphere casting to ensure reliable pokes; as a demonstration, // this simple interactor only performs trigger intersections. pokeTrajectory.Start = pokeTrajectory.End; pokeTrajectory.End = attachTransform.position; @@ -96,3 +104,4 @@ private void FixedUpdate() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs index 294892351cd..f7f97223f2b 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System.Collections.Generic; using UnityEngine; using TMPro; @@ -9,8 +12,8 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Demos { /// /// Manager for the performance evaluation scene. - /// It instantiates gameobjects until the FPS drops below a set - /// limit, currently 50 fps. + /// It instantiates game objects until the frame rate drops below a set + /// limit /// public class PerfSceneManager : MonoBehaviour { @@ -200,3 +203,4 @@ public void SetModelCount(int count) } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/SampleSceneHandMenu.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/SampleSceneHandMenu.cs index 556e3e905b7..b7b2cc7c6c2 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/SampleSceneHandMenu.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/SampleSceneHandMenu.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using Microsoft.MixedReality.Toolkit.Input; using Microsoft.MixedReality.Toolkit.UX; using Microsoft.MixedReality.Toolkit.Diagnostics; @@ -130,3 +133,4 @@ public void GoToPreviousScene() private bool IsSceneValid(int buildIndex) => buildIndex < SceneManager.sceneCountInBuildSettings && buildIndex >= 0; } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/ScrollRectCurve.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/ScrollRectCurve.cs index a536eac381e..b9afb866d95 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/ScrollRectCurve.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/ScrollRectCurve.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -9,16 +12,21 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Demos { /// - /// This component works on the content of a ScrollRect window! It will - /// 'curve' the position and orientation of contents based on their - /// position within the ScrollRect's viewport. - /// - /// This component should be placed on the "Content" GameObject of a Scroll - /// View, as it uses OnTransformChildrenChanged, and works directly on the - /// children of the GameObject it's assigned to. This component will not - /// look great on items that are vertically large, as items are curved at a - /// GameObject level. Their contents will remain flat. + /// This component works on the content of a window. /// + /// + /// + /// This will 'curve' the position and orientation of contents based on their + /// position within the viewport of the . + /// + /// + /// This component should be placed on the "Content" in + /// a scroll view, as it uses , and works + /// directly on the children of the it's assigned to. + /// This component will not look great on items that are vertically large, as + /// items are curved at a level. Their contents will remain flat. + /// + /// [AddComponentMenu("MRTK/Examples/Scroll Rect Curve")] public class ScrollRectCurve : MonoBehaviour { @@ -45,7 +53,7 @@ private void Awake() private void OnTransformChildrenChanged() => UpdatePositions(); /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() => UpdatePositions(); @@ -91,3 +99,4 @@ private void UpdatePositions() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/SystemKeyboardExample.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/SystemKeyboardExample.cs index e6237c1d538..02611407d10 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/SystemKeyboardExample.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/SystemKeyboardExample.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using Microsoft.MixedReality.Toolkit.Input; using Microsoft.MixedReality.Toolkit.UX; using TMPro; @@ -9,8 +12,8 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Demos { /// - /// An example script that delegates keyboard API access either to the WMR MixedRealityKeyboard - /// or Unity's TouchScreenKeyboard API depending on the platform. + /// An example script that delegates keyboard API access either to the WinRT MixedRealityKeyboard class + /// or Unity's class depending on the platform. /// /// /// Note that like Unity's TouchScreenKeyboard API, this script only supports WSA, iOS, and Android. @@ -143,7 +146,7 @@ private void Update() { // non-Windows mixed reality keyboard initialization goes here // for non-Windows mixed reality keyboards just use Unity's default - // touchscreenkeyboard. + // touch screen keyboard. if (touchscreenKeyboard != null) { string KeyboardText = touchscreenKeyboard.text; @@ -170,3 +173,4 @@ private void Update() #endregion MonoBehaviour Implementation } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/TetheredPlacement.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/TetheredPlacement.cs index d9ca0a5c597..aab81567bdf 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/TetheredPlacement.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/TetheredPlacement.cs @@ -1,13 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + + using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Examples.Demos { /// - /// Helper script to respawn objects if they go too far from their original position. Useful for objects that will fall forever etc. + /// Helper script to re-spawn objects if they go too far from their original position. /// + /// + /// The helper is useful for objects that will fall forever. + /// [AddComponentMenu("MRTK/Examples/Tethered Placement")] internal class TetheredPlacement : MonoBehaviour { @@ -52,3 +59,4 @@ private void LateUpdate() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/ToggleCollectionColorChange.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/ToggleCollectionColorChange.cs index c2d802468cf..da4eaeff4d3 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/ToggleCollectionColorChange.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/ToggleCollectionColorChange.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using Microsoft.MixedReality.Toolkit.UX; using UnityEngine; @@ -27,7 +30,7 @@ public ToggleCollection ToggleCollection private MeshRenderer meshRenderer; /// - /// he mesh renderer to update for this color changer. + /// The mesh renderer to update for this color changer. /// public MeshRenderer MeshRenderer { @@ -73,3 +76,4 @@ private void Start() } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/ToggleCollectionObjectActivate.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/ToggleCollectionObjectActivate.cs index 3ce7ff6d8a1..c00a974402f 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/ToggleCollectionObjectActivate.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/ToggleCollectionObjectActivate.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using Microsoft.MixedReality.Toolkit.UX; using UnityEngine; @@ -35,3 +38,4 @@ private void Set(int index) } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/VirtualizedScrollRectListTester.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/VirtualizedScrollRectListTester.cs index 0f8ef229e1f..dfb8b41b426 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/VirtualizedScrollRectListTester.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/VirtualizedScrollRectListTester.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using TMPro; using UnityEngine; using Microsoft.MixedReality.Toolkit.UX.Experimental; @@ -60,14 +63,18 @@ private void Update() } } - /// Scrolls the VirtualizedScrollRect to the next page. + /// + /// Scrolls the VirtualizedScrollRect to the next page. + /// public void Next() { sinScroll = false; animate = true; destScroll = Mathf.Min(list.MaxScroll, Mathf.Floor(list.Scroll / list.RowsOrColumns) * list.RowsOrColumns + list.TotallyVisibleCount); } - /// Scrolls the VirtualizedScrollRect to the previous page. + /// + /// Scrolls the VirtualizedScrollRect to the previous page. + /// public void Prev() { sinScroll = false; @@ -75,13 +82,19 @@ public void Prev() destScroll = Mathf.Max(0, Mathf.Floor(list.Scroll / list.RowsOrColumns) * list.RowsOrColumns - list.TotallyVisibleCount); } - /// Testing function for adjusting the number of items during - /// runtime. + /// + /// Testing function for adjusting the number of items during + /// runtime. + /// [ContextMenu("Set Item Count 50")] public void TestItemCount1() => list.SetItemCount(50); - /// Testing function for adjusting the number of items during - /// runtime. + + /// + /// Testing function for adjusting the number of items during + /// runtime. + /// [ContextMenu("Set Item Count 200")] public void TestItemCount2() => list.SetItemCount(200); } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/Whiteboard.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/Whiteboard.cs index ea4cfc13e63..524a5df265e 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/Whiteboard.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/Whiteboard.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System.Collections.Generic; using UnityEngine; using Unity.Collections; @@ -143,3 +146,4 @@ private void DrawSplat(Vector2 pixelCoordinate, NativeArray data) } } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryInformationProfile.cs b/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryInformationProfile.cs index efbaacacf50..c5c4e9319fe 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryInformationProfile.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryInformationProfile.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System; using UnityEngine; @@ -45,3 +48,4 @@ public class BatteryLevelProfile // Other battery related assets could go here such as for lifetime battery charge/discharge cycles, or battery malfunction warning icons. } } +#pragma warning restore CS1591 \ No newline at end of file diff --git a/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryLevelDataSource.cs b/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryLevelDataSource.cs index e882a6e067d..8f384e75104 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryLevelDataSource.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/UX Theming Example/Scripts/BatteryLevelDataSource.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples. +#pragma warning disable CS1591 + using System; using UnityEngine; @@ -9,7 +12,7 @@ namespace Microsoft.MixedReality.Toolkit.Data /// /// A data source that manages a battery level and provides information that can be /// used by any data consumer related to battery level. - /// + /// /// /// /// As the battery level and charging state change, the desired icon may change. @@ -25,14 +28,38 @@ namespace Microsoft.MixedReality.Toolkit.Data /// The information this data source makes available are managed in a dictionary with the /// following key paths available for data consumers: /// - /// - /// Data Type Keypath Description - /// ======================================================== - /// Sprite batteryIcon The current sprite - /// bool isCharging Whether currently in a charging state - /// string label Status text, usually a % of charge - /// int intLevel Integral level from 0 .. # sprites - 1 - /// float realLevel Analog level from 0..1 + /// + /// + /// Date Type + /// Key Path + /// Description + /// + /// + /// Sprite + /// batteryIcon + /// The current sprite. + /// + /// + /// bool + /// isCharging + /// Whether currently in a charging state. + /// + /// + /// string + /// label + /// Status text, usually a percentage of charge. + /// + /// + /// int + /// intLevel + /// Integral level from 0 to the number of sprites - 1. + /// + /// + /// float + /// realLevel + /// Analog level from 0 to 1. + /// + /// /// [Serializable] [AddComponentMenu("MRTK/Examples/Battery Level Data Source")] @@ -197,7 +224,7 @@ protected virtual int CalculateIntegralLevelFromAnalogLevel(float level, bool ch } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { @@ -216,5 +243,4 @@ protected float ValidateBatteryLevel(float level) } } } - - +#pragma warning restore CS1591 \ No newline at end of file diff --git a/com.microsoft.mrtk.audio/Effects/AudioBandPassFilter.cs b/com.microsoft.mrtk.audio/Effects/AudioBandPassFilter.cs index 63a618882a7..e95f3c44b69 100644 --- a/com.microsoft.mrtk.audio/Effects/AudioBandPassFilter.cs +++ b/com.microsoft.mrtk.audio/Effects/AudioBandPassFilter.cs @@ -6,9 +6,11 @@ namespace Microsoft.MixedReality.Toolkit.Audio { /// - /// Defines an audio bandpass (frequencies between a lower and upper value - /// are preserved) filter. + /// Defines an audio band pass filter. /// + /// + /// Frequencies between a lower and upper value are preserved. + /// [CreateAssetMenu(fileName = "BandPassFilter.asset", menuName = "MRTK/Audio/Bandpass Filter")] public class AudioBandPassFilter : ScriptableObject { @@ -33,7 +35,7 @@ public float LowFrequencyCutoff /// /// The frequency above which sound will not be heard. - /// public float HighFrequencyCutoff { get => highFrequencyCutoff; diff --git a/com.microsoft.mrtk.audio/Effects/AudioInfluencerController.cs b/com.microsoft.mrtk.audio/Effects/AudioInfluencerController.cs index a768e4b9635..793436bc88f 100644 --- a/com.microsoft.mrtk.audio/Effects/AudioInfluencerController.cs +++ b/com.microsoft.mrtk.audio/Effects/AudioInfluencerController.cs @@ -12,8 +12,10 @@ namespace Microsoft.MixedReality.Toolkit.Audio /// Class which supports components implementing . /// /// + /// /// AudioInfluencerController requires an AudioSource component. /// If one is not attached, it will be added automatically. + /// /// /// Each sound playing game object should have an AudioInfluencerController /// attached in order to have its audio properly influenced. @@ -47,43 +49,55 @@ public class AudioInfluencerController : MonoBehaviour /// private AudioSource audioSource; + [Tooltip("Time, in seconds, between audio influence updates. 0 indicates to update every frame.")] + [Range(0.0f, 1.0f)] + [SerializeField] + private float updateInterval = 0.25f; + /// /// Time, in seconds, between audio influence updates. /// /// + /// /// The UpdateInterval range is between 0.0 and 1.0, inclusive. The default /// value is 0.25. + /// /// - /// A value of 0.0f indicates that updates occur every frame. + /// A value of 0.0 indicates that updates occur every frame. /// /// - [Tooltip("Time, in seconds, between audio influence updates. 0 indicates to update every frame.")] - [Range(0.0f, 1.0f)] - [SerializeField] - private float updateInterval = 0.25f; public float UpdateInterval { - get { return updateInterval; } + get + { + return updateInterval; + } + set { updateInterval = Mathf.Clamp(value, 0.0f, 1.0f); } } + [Tooltip("Maximum distance, in meters, to look when attempting to find the user and any influencers.")] + [Range(1.0f, 50.0f)] + [SerializeField] + private float maxDistance = 20.0f; + /// /// Maximum distance, in meters, to look when attempting to find the user and - /// any influencers. + /// any influencer. /// /// - /// The MaxDistance range is 1.0 to 50.0, inclusive. The default value is 20.0. + /// The max distance range is 1.0 to 50.0, inclusive. The default value is 20.0. /// - [Tooltip("Maximum distance, in meters, to look when attempting to find the user and any influencers.")] - [Range(1.0f, 50.0f)] - [SerializeField] - private float maxDistance = 20.0f; public float MaxDistance { - get { return maxDistance; } + get + { + return maxDistance; + } + set { maxDistance = Mathf.Clamp(value, 1.0f, 50.0f); @@ -91,14 +105,16 @@ public float MaxDistance } /// - /// Maximum number of objects that will be considered when looking for influencers. + /// Maximum number of objects that will be considered when looking for an influencer. + /// + /// + /// /// Setting this value too high may have a negative impact on the performance of your /// experience. - /// - /// - /// MaxObjects can only be set in the Unity Inspector. - /// The MaxObjects range is 1 to 25, inclusive. - /// The default value is 10. + /// + /// This value can only be set in Unity's inspector windows, in a range from 1 to 25, inclusive. + /// The default value is 10. + /// /// [Tooltip("Maximum number of objects that will be considered when looking for influencers.")] [Range(1, 25)] diff --git a/com.microsoft.mrtk.core/Data/Binding Templates/UXBindingProfileTemplate.cs b/com.microsoft.mrtk.core/Data/Binding Templates/UXBindingProfileTemplate.cs index 15a20fa910c..27c894753ec 100644 --- a/com.microsoft.mrtk.core/Data/Binding Templates/UXBindingProfileTemplate.cs +++ b/com.microsoft.mrtk.core/Data/Binding Templates/UXBindingProfileTemplate.cs @@ -15,7 +15,7 @@ namespace Microsoft.MixedReality.Toolkit /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, appear - /// to have a lot of value even if the details haven’t fully been fleshed out. + /// 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 enough so to provide feedback. /// diff --git a/com.microsoft.mrtk.core/Utilities/ControllerLookup.cs b/com.microsoft.mrtk.core/Utilities/ControllerLookup.cs index d04f56bf4ec..51454c7fba7 100644 --- a/com.microsoft.mrtk.core/Utilities/ControllerLookup.cs +++ b/com.microsoft.mrtk.core/Utilities/ControllerLookup.cs @@ -57,7 +57,7 @@ public XRBaseController RightHandController } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/DataSources/DataSourceGODictionary.cs b/com.microsoft.mrtk.data/Runtime/Scripts/DataSources/DataSourceGODictionary.cs index 839d52e3480..a48c48af0cc 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/DataSources/DataSourceGODictionary.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/DataSources/DataSourceGODictionary.cs @@ -96,7 +96,7 @@ private void Update() } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataSourceProviderSingleton.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataSourceProviderSingleton.cs index 2f25c9a09c3..d1044985859 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataSourceProviderSingleton.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Helper/DataSourceProviderSingleton.cs @@ -121,7 +121,7 @@ public static IDataSourceProvider Instance } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.data/Runtime/Scripts/Helper/ThemeSelector.cs b/com.microsoft.mrtk.data/Runtime/Scripts/Helper/ThemeSelector.cs index 198399e6308..5ee64e0c168 100644 --- a/com.microsoft.mrtk.data/Runtime/Scripts/Helper/ThemeSelector.cs +++ b/com.microsoft.mrtk.data/Runtime/Scripts/Helper/ThemeSelector.cs @@ -56,7 +56,7 @@ private void OnStart() } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.input/InteractionModes/InteractionModeManager.cs b/com.microsoft.mrtk.input/InteractionModes/InteractionModeManager.cs index dac0b494b6a..2351f12b7a9 100644 --- a/com.microsoft.mrtk.input/InteractionModes/InteractionModeManager.cs +++ b/com.microsoft.mrtk.input/InteractionModes/InteractionModeManager.cs @@ -299,7 +299,7 @@ private void Awake() } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.input/Interactors/InteractorVisuals/MRTKLineVisual.cs b/com.microsoft.mrtk.input/Interactors/InteractorVisuals/MRTKLineVisual.cs index 7bbafbeeaec..d6183ef66e0 100644 --- a/com.microsoft.mrtk.input/Interactors/InteractorVisuals/MRTKLineVisual.cs +++ b/com.microsoft.mrtk.input/Interactors/InteractorVisuals/MRTKLineVisual.cs @@ -219,7 +219,7 @@ protected void Reset() #if UNITY_EDITOR /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// protected void OnValidate() { diff --git a/com.microsoft.mrtk.spatialmanipulation/BoundsControl/ScaleHandleInteractable.cs b/com.microsoft.mrtk.spatialmanipulation/BoundsControl/ScaleHandleInteractable.cs index 210def367dd..2385677325a 100644 --- a/com.microsoft.mrtk.spatialmanipulation/BoundsControl/ScaleHandleInteractable.cs +++ b/com.microsoft.mrtk.spatialmanipulation/BoundsControl/ScaleHandleInteractable.cs @@ -27,7 +27,7 @@ internal class ScaleHandleInteractable : BoundsHandleInteractable #region MonoBehaviour Methods /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.spatialmanipulation/ObjectManipulator/ObjectManipulator.cs b/com.microsoft.mrtk.spatialmanipulation/ObjectManipulator/ObjectManipulator.cs index e6c06c7dd79..acf81054e8e 100644 --- a/com.microsoft.mrtk.spatialmanipulation/ObjectManipulator/ObjectManipulator.cs +++ b/com.microsoft.mrtk.spatialmanipulation/ObjectManipulator/ObjectManipulator.cs @@ -555,7 +555,7 @@ protected override void Reset() } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ButtonTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ButtonTheme.cs index 8aec1746599..f216ef9a174 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ButtonTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ButtonTheme.cs @@ -7,21 +7,24 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// All themable elements of a MRTK UX Button. - /// - /// Note that by default whenever a themable element - /// is shared by different control types, the same - /// element is repeated in UX.Common and the default - /// theme for that element is pointed to UX.Common.xxx - /// instead of UX.Button.xxx. + /// All theme elements of a MRTK UX Button. /// /// + /// + /// Note, that by default whenever a theme element + /// is shared by different control types, the same + /// element is repeated in UX.Common and the default + /// theme for that element is pointed to UX.Common.xxx + /// instead of UX.Button.xxx. + /// + /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, appear - /// to have a lot of value even if the details haven’t fully been fleshed out. + /// 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 enough so to provide feedback. + /// /// [Serializable] public class ButtonTheme @@ -29,66 +32,118 @@ public class ButtonTheme [Tooltip("Material for highlighting the backplate.")] [SerializeField] private Material backplateHighlightMaterial; + + /// + /// Material for highlighting the backplate. + /// public Material BackplateHighlightMaterial => backplateHighlightMaterial; - [Tooltip("Material for highlighting the frontplate.")] + [Tooltip("Material for highlighting the front plate.")] [SerializeField] private Material frontplateHighlightMaterial; + + /// + /// Material for highlighting the front plate. + /// public Material FrontplateHighlightMaterial => frontplateHighlightMaterial; [Tooltip("Material for 'See It. Say It' backplate.")] [SerializeField] private Material seeItSayItBackplateQuadMaterial; + + /// + /// Material for 'See It. Say It' backplate. + /// public Material SeeItSayItBackplateQuadMaterial => seeItSayItBackplateQuadMaterial; [Tooltip("Material for showing the outer rim geometry.")] [SerializeField] private Material backplateOuterGeometryMaterial; + + /// + /// Material for showing the outer rim geometry. + /// public Material BackplateOuterGeometryMaterial => backplateOuterGeometryMaterial; [Tooltip("Material for showing change of state on the backplate.")] [SerializeField] private Material backplateQuadMaterial; + + /// + /// Material for showing change of state on the backplate. + /// public Material BackplateQuadMaterial => backplateQuadMaterial; [Tooltip("Material for showing the toggle true or false state.")] [SerializeField] private Material backplateToggleQuadMaterial; + + /// + /// Material for showing the toggle true or false state. + /// public Material BackplateToggleQuadMaterial => backplateToggleQuadMaterial; [Tooltip("Material for highlighting the backplate for circular button.")] [SerializeField] private Material circularBackplateHighlightMaterial; + + /// + /// Material for highlighting the backplate for circular button. + /// public Material CircularBackplateHighlightMaterial => circularBackplateHighlightMaterial; - [Tooltip("Material for highlighting the frontplate for circular button.")] + [Tooltip("Material for highlighting the front plate for circular button.")] [SerializeField] private Material circularFrontplateHighlightMaterial; + + /// + /// Material for highlighting the front plate for circular button. + /// public Material CircularFrontplateHighlightMaterial => circularFrontplateHighlightMaterial; [Tooltip("Material for showing the outer rim geometry for circular button.")] [SerializeField] private Material circularBackplateOuterGeometryMaterial; + + /// + /// Material for showing the outer rim geometry for circular button. + /// public Material CircularBackplateOuterGeometryMaterial => circularBackplateOuterGeometryMaterial; [Tooltip("Material for showing change of state on the backplate for circular button.")] [SerializeField] private Material circularBackplateQuadMaterial; + + /// + /// Material for showing change of state on the backplate for circular button. + /// public Material CircularBackplateQuadMaterial => circularBackplateQuadMaterial; [Tooltip("Material for showing the toggle true or false state for circular button.")] [SerializeField] private Material circularBackplateToggleQuadMaterial; + + /// + /// Material for showing the toggle true or false state for circular button. + /// public Material CircularBackplateToggleQuadMaterial => circularBackplateToggleQuadMaterial; - [Tooltip("Name of TextMeshPro stylesheet to use for styling text.")] + [Tooltip("Name of TextMeshPro style sheet to use for styling text.")] [SerializeField] private string textStyleSheetName; + + /// + /// Name of TextMeshPro style sheet to use for styling text + /// public string TextStyleSheetName => textStyleSheetName; [Tooltip("Sprite set for selecting sprites from a key or index.")] [SerializeField] private SpriteSetTheme spriteSet; + + /// + /// Sprite set for selecting sprites from a key or index. + /// public SpriteSetTheme SpriteSet => spriteSet; } } diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/CommonTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/CommonTheme.cs index ef6682f97c4..edb5dae1bb8 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/CommonTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/CommonTheme.cs @@ -7,11 +7,14 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { + /// + /// Button control theme elements. + /// /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, appear - /// to have a lot of value even if the details haven’t fully been fleshed out. + /// 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 enough so to provide feedback. /// @@ -20,10 +23,18 @@ public class CommonTheme { [SerializeField] private TMP_StyleSheet textStyleSheet; + + /// + /// The text style sheet. + /// public TMP_StyleSheet TextStyleSheet => textStyleSheet; [SerializeField] private SpriteSetTheme spriteSet; + + /// + /// The sprint set theme. + /// public SpriteSetTheme SpriteSet => spriteSet; } } diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/DialogTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/DialogTheme.cs index 045c7c3e9ac..b62fea42d98 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/DialogTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/DialogTheme.cs @@ -7,19 +7,22 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// All themable elements of a MRTK UX Dialog slate. - /// - /// Note that by default the UXBindingProfile only maps - /// to UX.Common.xxx instead of UX.Dialog.xxx for any - /// element that is common across all UX elements. + /// All theme elements of a MRTK Dialog. /// /// + /// + /// Note that by default the only maps + /// to UX.Common.xxx instead of UX.Dialog.xxx for any + /// element that is common across all UX elements. + /// + /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, appear - /// to have a lot of value even if the details haven’t fully been fleshed out. + /// 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 enough so to provide feedback. + /// value out of them early enough so to provide feedback. + /// /// [Serializable] public class DialogTheme @@ -27,6 +30,10 @@ public class DialogTheme [Tooltip("Backplate material for a dialog slate.")] [SerializeField] private Material backplateMaterial; + + /// + /// Backplate material for a dialog slate. + /// public Material BackplateMaterial => backplateMaterial; } diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/HandMenuTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/HandMenuTheme.cs index ea001140656..8001c434fae 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/HandMenuTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/HandMenuTheme.cs @@ -7,19 +7,22 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// All themable elements of a MRTK UX Dialog slate. - /// - /// Note that by default the UXBindingProfile only maps - /// to UX.Common.xxx instead of UX.HandMenu.xxx for any - /// element that is common across all UX elements. + /// All theme elements of a MRTK UX Dialog slate. /// /// + /// + /// Note that by default the only maps + /// to UX.Common.xxx instead of UX.HandMenu.xxx for any + /// element that is common across all UX elements. + /// + /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, appear - /// to have a lot of value even if the details haven’t fully been fleshed out. + /// 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 enough so to provide feedback. + /// /// [Serializable] public class HandMenuTheme @@ -27,6 +30,10 @@ public class HandMenuTheme [Tooltip("Backplate material for a hand menu.")] [SerializeField] private Material backplateMaterial; + + /// + /// Backplate material for a hand menu. + /// public Material BackplateMaterial => backplateMaterial; } } diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ListMenuTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ListMenuTheme.cs index c818b170e32..bb2b2eeb101 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ListMenuTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ListMenuTheme.cs @@ -7,19 +7,22 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// All themable elements of a MRTK UX Dialog slate. - /// - /// Note that by default the UXBindingProfile only maps - /// to UX.Common.xxx instead of UX.List.xxx for any - /// element that is common across all UX elements. + /// All theme elements of a MRTK UX Dialog slate. /// /// + /// + /// Note that by default the only maps + /// to UX.Common.xxx instead of UX.List.xxx for any + /// element that is common across all UX elements. + /// + /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, appear - /// to have a lot of value even if the details haven’t fully been fleshed out. + /// 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 enough so to provide feedback. + /// /// [Serializable] public class ListMenuTheme @@ -27,6 +30,10 @@ public class ListMenuTheme [Tooltip("Backplate material for a list menu.")] [SerializeField] private Material backplateMaterial; + + /// + /// Backplate material for a list menu. + /// public Material BackplateMaterial => backplateMaterial; } } diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ObjectBarTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ObjectBarTheme.cs index 04372805c3a..de7208e88c3 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ObjectBarTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ObjectBarTheme.cs @@ -9,15 +9,15 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental /// /// All themable elements of a MRTK UX Dialog slate. /// - /// Note that by default the UXBindingProfile only maps - /// to UX.Common.xxx instead of UX.ObjectBar.xxx for any + /// Note that by default the only maps + /// to UX.Common.xxx instead of UX.ObjectBar.xxx for any /// element that is common across all UX elements. /// /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, appear - /// to have a lot of value even if the details haven’t fully been fleshed out. + /// 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 enough so to provide feedback. /// diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SlateTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SlateTheme.cs index 3eb2d5f720d..8ccb0b95f40 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SlateTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SlateTheme.cs @@ -9,15 +9,15 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental /// /// All themable elements of a MRTK UX Dialog slate. /// - /// Note that by default the UXBindingProfile only maps - /// to UX.Common.xxx instead of UX.Slate.xxx for any + /// Note that by default the only maps + /// to UX.Common.xxx instead of UX.Slate.xxx for any /// element that is common across all UX elements. /// /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, appear - /// to have a lot of value even if the details haven’t fully been fleshed out. + /// 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 enough so to provide feedback. /// diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SliderTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SliderTheme.cs index 9eb78c02b24..5031a8e1da4 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SliderTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SliderTheme.cs @@ -9,15 +9,15 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental /// /// All themable elements of a MRTK UX Slider. /// - /// Note that by default the UXBindingProfile only maps - /// to UX.Common.xxx instead of UX.Button.xxx for any + /// Note that by default the only maps + /// to UX.Common.xxx instead of UX.Button.xxx for any /// element that is common across all UX elements. /// /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, appear - /// to have a lot of value even if the details haven’t fully been fleshed out. + /// 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 enough so to provide feedback. /// diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ToggleTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ToggleTheme.cs index b04b336b243..216e8caac05 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ToggleTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ToggleTheme.cs @@ -9,15 +9,15 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental /// /// All themable elements of a MRTK UX Dialog slate. /// - /// Note that by default the UXBindingProfile only maps - /// to UX.Common.xxx instead of UX.Toggle.xxx for any + /// Note that by default the only maps + /// to UX.Common.xxx instead of UX.Toggle.xxx for any /// element that is common across all UX elements. /// /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, appear - /// to have a lot of value even if the details haven’t fully been fleshed out. + /// 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 enough so to provide feedback. /// diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/UXThemeProfile.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/UXThemeProfile.cs index 4fd33da4907..be27eec4fb4 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/UXThemeProfile.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/UXThemeProfile.cs @@ -10,81 +10,125 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental public class UXThemeProfile : ScriptableObject { /// - /// The conceptual elements in left-to-right dot notation order are: - /// - Global category(UX)� All themes in this category are for UX elements - /// - UX Control Type � The nature of the control(eg.Button, Slider, Checkbox, Slate, Common). This should generally map 1-to-1 to a specific prefab.Common can be used to specify fallback properties across all UX controls. - /// - UX Control Part � A specific sub-part of the control (eg.Thumb for a slider). For more complex controls, this could be a compound part such as ScaleTickMarks - /// - Component category � The component being themed(eg.Text, Material, Sprite). In general, this should reflect the name of the component MonoBehavior. - /// - Optional Property � A specific property of that component (eg.Color, StyleSheet - + /// A theme profile for UX components. /// /// + /// + /// The conceptual elements in left-to-right dot notation order are: + /// + /// + /// + /// Global category (UX) + /// All themes in this category are for UX elements. + /// + /// + /// UX Control Type + /// The nature of the control; for example, , , , , . This should generally map 1-to-1 to a specific prefab.Common can be used to specify fallback properties across all UX controls. + /// + /// + /// UX Control Part + /// A specific sub-part of the control; for example, a thumb for a slider. For more complex controls, this could be a compound part. + /// + /// + /// Component category + /// The component being themed; for example, text, a material, or a sprint. In general, this should reflect the name of the component . + /// + /// + /// Optional Property + /// A specific property of that component; for example, color or style sheet. + /// + /// + /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, 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 enough so to provide feedback. + /// /// [Serializable] public class UXTheme { - /// - /// Button control themable elements - /// [SerializeField, Experimental] private CommonTheme common; - public CommonTheme Common => common; + /// - /// Button control themable elements + /// Button control theme elements. /// + public CommonTheme Common => common; + [SerializeField] private ButtonTheme button; - public ButtonTheme Button => button; /// - /// Slider control themable elements + /// Button control theme elements. /// + public ButtonTheme Button => button; + [SerializeField] private SliderTheme slider; - public SliderTheme Slider => slider; /// - /// Dialog slate themable elements + /// Slider control theme elements. /// + public SliderTheme Slider => slider; + [SerializeField] private DialogTheme dialog; - public DialogTheme Dialog => dialog; /// - /// Handmenu themable elements + /// Dialog slate theme elements. /// + public DialogTheme Dialog => dialog; + [SerializeField] private HandMenuTheme handMenu; - public HandMenuTheme HandMenu => handMenu; /// - /// Handmenu themable elements + /// Hand menu theme elements. /// + public HandMenuTheme HandMenu => handMenu; + [SerializeField] private ListMenuTheme listMenu; + + /// + /// Hand menu theme elements. + /// public ListMenuTheme ListMenu => listMenu; [SerializeField] private ObjectBarTheme objectBar; + + /// + /// Object bar theme elements. + /// public ObjectBarTheme ObjectBar => objectBar; [SerializeField] private SlateTheme slate; + + /// + /// Slate theme elements. + /// public SlateTheme Slate => slate; [SerializeField] private ToggleTheme toggle; + + /// + /// Toggle theme elements. + /// public ToggleTheme Toggle => toggle; } [SerializeField] - private UXTheme ux; // Establishes the root of the namespace. + private UXTheme ux; + + /// + /// The root of the namespace. + /// public UXTheme UX => ux; } } diff --git a/com.microsoft.mrtk.uxcore/Button/PressableButton.cs b/com.microsoft.mrtk.uxcore/Button/PressableButton.cs index 62259414407..a29aed30589 100644 --- a/com.microsoft.mrtk.uxcore/Button/PressableButton.cs +++ b/com.microsoft.mrtk.uxcore/Button/PressableButton.cs @@ -263,7 +263,7 @@ protected override void OnDisable() } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.uxcore/Dialog/DialogPool.cs b/com.microsoft.mrtk.uxcore/Dialog/DialogPool.cs index e34345dee34..6e24850e9e2 100644 --- a/com.microsoft.mrtk.uxcore/Dialog/DialogPool.cs +++ b/com.microsoft.mrtk.uxcore/Dialog/DialogPool.cs @@ -55,7 +55,7 @@ public enum Policy private const string CanvasDialogPrefabGUID = "cca6164bb2744884a92a100266f5f3aa"; /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// protected virtual void OnValidate() { diff --git a/com.microsoft.mrtk.uxcore/Experimental/List/VirtualizedScrollRectList.cs b/com.microsoft.mrtk.uxcore/Experimental/List/VirtualizedScrollRectList.cs index a32fdee2929..64ce74c98e2 100644 --- a/com.microsoft.mrtk.uxcore/Experimental/List/VirtualizedScrollRectList.cs +++ b/com.microsoft.mrtk.uxcore/Experimental/List/VirtualizedScrollRectList.cs @@ -265,7 +265,7 @@ private float ScrollToPos(float scroll) => layoutDirection == Layout.Vertical : (-scroll * (layoutPrefabSize / layoutRowsOrColumns)) + (margin - gutter); /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.uxcore/Experimental/NonNativeKeyboard/NonNativeValueKey.cs b/com.microsoft.mrtk.uxcore/Experimental/NonNativeKeyboard/NonNativeValueKey.cs index 32041110797..873abea19ee 100644 --- a/com.microsoft.mrtk.uxcore/Experimental/NonNativeKeyboard/NonNativeValueKey.cs +++ b/com.microsoft.mrtk.uxcore/Experimental/NonNativeKeyboard/NonNativeValueKey.cs @@ -99,7 +99,7 @@ private void Start() } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.uxcore/FontIcons/FontIconSelector.cs b/com.microsoft.mrtk.uxcore/FontIcons/FontIconSelector.cs index 9ba0f8d6fb2..380afb9dc7d 100644 --- a/com.microsoft.mrtk.uxcore/FontIcons/FontIconSelector.cs +++ b/com.microsoft.mrtk.uxcore/FontIcons/FontIconSelector.cs @@ -65,7 +65,7 @@ private void Awake() } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.uxcore/Interop/UGUIInputAdapter.cs b/com.microsoft.mrtk.uxcore/Interop/UGUIInputAdapter.cs index d744a8c64ff..b61a538cd4b 100644 --- a/com.microsoft.mrtk.uxcore/Interop/UGUIInputAdapter.cs +++ b/com.microsoft.mrtk.uxcore/Interop/UGUIInputAdapter.cs @@ -104,7 +104,7 @@ internal protected XRInteractionManager InteractionManager #if UNITY_EDITOR /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// protected override void OnValidate() { diff --git a/com.microsoft.mrtk.uxcore/LegacyDialog/DialogButton.cs b/com.microsoft.mrtk.uxcore/LegacyDialog/DialogButton.cs index 802d9f72e90..5b336af02c2 100644 --- a/com.microsoft.mrtk.uxcore/LegacyDialog/DialogButton.cs +++ b/com.microsoft.mrtk.uxcore/LegacyDialog/DialogButton.cs @@ -58,7 +58,7 @@ public TMP_Text ButtonText public DialogButtonContext ButtonContext => buttonContext; /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// [Obsolete("This legacy dialog system has been deprecated. Please migrate to the new dialog system, see Microsoft.MixedReality.Toolkit.UX.DialogPool for more details.")] diff --git a/com.microsoft.mrtk.uxcore/Slider/Slider.cs b/com.microsoft.mrtk.uxcore/Slider/Slider.cs index 67b09c6e867..bbf9b84890a 100644 --- a/com.microsoft.mrtk.uxcore/Slider/Slider.cs +++ b/com.microsoft.mrtk.uxcore/Slider/Slider.cs @@ -314,7 +314,7 @@ protected virtual void Start() } /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.uxcore/StateVisualizer/StateVisualizer.cs b/com.microsoft.mrtk.uxcore/StateVisualizer/StateVisualizer.cs index 7cd86f9b9eb..494978dacdd 100644 --- a/com.microsoft.mrtk.uxcore/StateVisualizer/StateVisualizer.cs +++ b/com.microsoft.mrtk.uxcore/StateVisualizer/StateVisualizer.cs @@ -150,7 +150,7 @@ public Animator Animator private Dictionary mixableIndices = new Dictionary(); /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { diff --git a/com.microsoft.mrtk.uxcore/Toggle/ToggleCollection.cs b/com.microsoft.mrtk.uxcore/Toggle/ToggleCollection.cs index 0c7021f6472..367f2167fac 100644 --- a/com.microsoft.mrtk.uxcore/Toggle/ToggleCollection.cs +++ b/com.microsoft.mrtk.uxcore/Toggle/ToggleCollection.cs @@ -99,7 +99,7 @@ public ToggleSelectedEvent OnToggleSelected private List> toggleActions = new List>(); /// - /// A Unity Editor-only event function that is called when the script is loaded or a value changes in the Unity Inspector. + /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// private void OnValidate() { From f5df0f4e6aafab553e5d47feb439984bcb3f3b24 Mon Sep 17 00:00:00 2001 From: Adam Mollis Date: Wed, 19 Jul 2023 14:05:20 -0700 Subject: [PATCH 04/10] More XML documentation changes. --- .../Assets/BuildAssets/BuildApp.cs | 13 + .../Subsystems/AccessibilitySubsystem.cs | 40 +- .../AccessibilitySubsystemDescriptor.cs | 31 +- .../MRTK/MRTKAccessibilitySubsystem.cs | 7 + com.microsoft.mrtk.core/Editor/AboutMRTK.cs | 3 + .../Editor/EditorProjectUtilities.cs | 3 + .../Editor/Editors/BaseInteractableEditor.cs | 18 +- .../Editor/Editors/MRTKProfileEditor.cs | 7 +- .../Editor/Editors/MRTKSettingsEditor.cs | 3 + .../Editors/StatefulInteractableEditor.cs | 51 +-- .../Editor/MRTKBuildProcessor.cs | 2 +- .../Editor/MRTKProjectValidation.cs | 6 + .../Editor/MRTKSettings.cs | 10 +- .../PropertyDrawers/DrawIfPropertyDrawer.cs | 8 +- .../PropertyDrawers/ExperimentalDrawer.cs | 2 +- .../InterfaceSelectorDrawer.cs | 8 + .../LabelWidthAttributeDrawer.cs | 4 + .../SelectRepairedTypeWindow.cs | 20 +- .../TimedFlagPropertyDrawer.cs | 10 +- .../TypeReferencePropertyDrawer.cs | 4 +- .../VariableRangeAttributeDrawer.cs | 7 + .../Editor/Utilities/GUIEnabledWrapper.cs | 18 +- .../Editor/Utilities/InspectorUIUtility.cs | 345 ++++++++++++++---- .../Editor/Utilities/MRTKEditorStyles.cs | 23 +- .../Utilities/PropertyDrawerUtilities.cs | 13 +- .../Utilities/ReserializeAssetsUtility.cs | 17 +- .../Tests/Editor/MRTK3ProfileEditorTest.cs | 4 +- .../TestUtilities/RuntimeTestUtilities.cs | 5 +- .../Inspectors/DataConsumerSpriteInspector.cs | 4 +- .../Inspectors/DataKeyPathMapperInspector.cs | 4 +- .../CameraSimulationSettingsDrawer.cs | 3 +- .../ControllerSimulationSettingsDrawer.cs | 4 +- .../EyeGazeSimulationSettingsDrawer.cs | 4 +- .../Inspectors/InteractionDetectorEditor.cs | 10 +- .../InteractionModePropertyDrawer.cs | 7 +- .../Runtime/Utilities/InputTestUtilities.cs | 6 +- .../Constraints/ConstraintManagerEditor.cs | 3 + .../ObjectManipulatorEditor.cs | 1 + .../Editor/Solvers/FollowEditor.cs | 6 + .../Editor/Solvers/InBetweenEditor.cs | 6 + .../Editor/Solvers/SolverEditor.cs | 6 + .../Editor/Solvers/SolverHandlerEditor.cs | 6 + .../Editor/Solvers/SurfaceMagnetismEditor.cs | 6 + .../Editor/Solvers/TapToPlaceEditor.cs | 9 +- .../SubsystemWizard/SubsystemGenerator.cs | 3 + .../SubsystemWizard/SubsystemWizardWindow.cs | 3 + .../ControlThemes/ButtonTheme.cs | 6 +- .../ControlThemes/CommonTheme.cs | 2 +- .../ControlThemes/DialogTheme.cs | 5 +- .../ControlThemes/HandMenuTheme.cs | 6 +- .../ControlThemes/ListMenuTheme.cs | 6 +- .../ControlThemes/ObjectBarTheme.cs | 19 +- .../ControlThemes/SlateTheme.cs | 25 +- .../ControlThemes/SliderTheme.cs | 33 +- .../ControlThemes/SpriteSetTheme.cs | 84 ++++- .../ControlThemes/ToggleTheme.cs | 35 +- .../ProfileTemplates/UXThemeProfile.cs | 5 +- .../FontIconSet/FontIconSelectorInspector.cs | 3 + .../FontIconSet/FontIconSetInspector.cs | 16 +- .../PressableButtonInspector.cs | 6 +- .../Inspectors/Slider/SliderInspector.cs | 4 + .../StateVisualizerInspector.cs | 3 + ...owsTextToSpeechSubsystemConfigInspector.cs | 6 + 63 files changed, 825 insertions(+), 212 deletions(-) diff --git a/UnityProjects/MRTKDevTemplate/Assets/BuildAssets/BuildApp.cs b/UnityProjects/MRTKDevTemplate/Assets/BuildAssets/BuildApp.cs index e605c4c5e99..f91f3461fc0 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/BuildAssets/BuildApp.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/BuildAssets/BuildApp.cs @@ -13,6 +13,9 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Build { + /// + /// A static class that provides functions for compiling the example scenes via command line. + /// public static class BuildApp { private static string[] scenes = { @@ -52,6 +55,9 @@ public static class BuildApp private static string buildPath = "build"; + /// + /// Build the Unity project's example scenes. + /// public static void StartCommandLineBuild() { ParseBuildCommandLine(); @@ -85,6 +91,13 @@ public static void StartCommandLineBuild() EditorApplication.Exit(success ? 0 : 1); } + /// + /// Ensure that the Text Mesh Pro assets are included in the Unity project. + /// + /// + /// This is currently not functioning correctly. When running via command line, + /// the assets are imported, but are not available in the built application. + /// public static void EnsureTMPro() { string assetsFullPath = Path.GetFullPath("Assets/TextMesh Pro"); diff --git a/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystem.cs b/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystem.cs index 79965eee2b5..e811aa1ec55 100644 --- a/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystem.cs +++ b/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystem.cs @@ -10,10 +10,11 @@ namespace Microsoft.MixedReality.Toolkit.Accessibility { - [Preserve] /// - /// A subsystem that exposes information about the current enabled assistive technologies. + /// A subsystem that exposes information about the current enabled + /// assistive technologies. /// + [Preserve] public class AccessibilitySubsystem : MRTKSubsystem, IAccessibilitySubsystem @@ -25,7 +26,7 @@ public AccessibilitySubsystem() { } /// - /// Interface for providing accessibility functionality for the implementation. + /// An abstract class for providing accessibility functionality for the implementation. /// [Preserve] public abstract class Provider : @@ -148,17 +149,28 @@ public void ApplyTextColorInversion( /// Thrown when the values specified in the /// parameter are invalid. Typically, this will occur /// - /// - /// if is or empty - /// - /// - /// if is - /// - /// - /// if does not derive from the - /// class - /// - /// + /// + /// + /// If is or empty. + /// + /// + /// + /// + /// If is . + /// + /// + /// + /// + /// The does not derive from + /// the type. + /// + /// + /// + /// + /// If does not derive from the + /// class. + /// + /// /// /// public static bool Register(AccessibilitySubsystemCinfo accessibilitySubsystemParams) diff --git a/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystemDescriptor.cs b/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystemDescriptor.cs index faca3dee022..9c1daa29166 100644 --- a/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystemDescriptor.cs +++ b/com.microsoft.mrtk.accessibility/Subsystems/AccessibilitySubsystemDescriptor.cs @@ -40,7 +40,10 @@ public struct AccessibilitySubsystemCinfo : /// Tests for equality. /// /// The other to compare against. - /// if every field in is equal to this , otherwise . + /// + /// if every field in is equal to this + /// , otherwise . + /// public bool Equals(AccessibilitySubsystemCinfo other) { return @@ -53,20 +56,29 @@ public bool Equals(AccessibilitySubsystemCinfo other) /// Tests for equality. /// /// The `object` to compare against. - /// if is of type and - /// also returns ; otherwise . + /// + /// if is of type and + /// also returns , + /// otherwise . + /// public override bool Equals(System.Object obj) { return (obj is AccessibilitySubsystemCinfo cinfo) && Equals(cinfo); } /// - /// Tests for equality. Same as . + /// Tests for equality. /// + /// + /// This is a same as . + /// /// The left-hand side of the comparison. /// The right-hand side of the comparison. - /// if is equal to , otherwise . - public static bool operator ==(AccessibilitySubsystemCinfo lhs, AccessibilitySubsystemCinfo rhs) + /// + /// if is equal to , + /// otherwise . + /// + public static bool operator==(AccessibilitySubsystemCinfo lhs, AccessibilitySubsystemCinfo rhs) { return lhs.Equals(rhs); } @@ -83,7 +95,8 @@ public override bool Equals(System.Object obj) } /// - /// This override is meant to disable hash lookups of objects. + /// This override is meant to disable hash lookups of + /// objects. /// /// /// This will throw a if called. @@ -108,7 +121,7 @@ public class AccessibilitySubsystemDescriptor : /// /// Initializes a new instance of the class. /// - /// The parameters required to initialize the descriptor. + /// The parameters required to initialize the descriptor. AccessibilitySubsystemDescriptor(AccessibilitySubsystemCinfo accessibilitySubsystemCinfo) { Name = accessibilitySubsystemCinfo.Name; @@ -164,4 +177,4 @@ internal static AccessibilitySubsystemDescriptor Create(AccessibilitySubsystemCi return new AccessibilitySubsystemDescriptor(cinfo); } } -} +} \ No newline at end of file diff --git a/com.microsoft.mrtk.accessibility/Subsystems/MRTK/MRTKAccessibilitySubsystem.cs b/com.microsoft.mrtk.accessibility/Subsystems/MRTK/MRTKAccessibilitySubsystem.cs index f2684178273..2e3541cef36 100644 --- a/com.microsoft.mrtk.accessibility/Subsystems/MRTK/MRTKAccessibilitySubsystem.cs +++ b/com.microsoft.mrtk.accessibility/Subsystems/MRTK/MRTKAccessibilitySubsystem.cs @@ -10,6 +10,10 @@ namespace Microsoft.MixedReality.Toolkit.Accessibility { + /// + /// The MRTK subsystem that exposes information about the current enabled + /// assistive technologies. + /// [Preserve] [MRTKSubsystem( Name = "com.microsoft.mixedreality.accessibility", @@ -32,6 +36,9 @@ static void Register() } } + /// + /// A class for providing accessibility functionality for the implementation. + /// [Preserve] class AccessibilityProvider : Provider { diff --git a/com.microsoft.mrtk.core/Editor/AboutMRTK.cs b/com.microsoft.mrtk.core/Editor/AboutMRTK.cs index 0449b1155fd..166e4c8f495 100644 --- a/com.microsoft.mrtk.core/Editor/AboutMRTK.cs +++ b/com.microsoft.mrtk.core/Editor/AboutMRTK.cs @@ -68,6 +68,9 @@ private static void EditorUpdate() private Vector2 scrollPos; + /// + /// A function called by Unity to render and handle GUI events. + /// private void OnGUI() { if (window == null) diff --git a/com.microsoft.mrtk.core/Editor/EditorProjectUtilities.cs b/com.microsoft.mrtk.core/Editor/EditorProjectUtilities.cs index f35f45f6d6f..b9587488e4a 100644 --- a/com.microsoft.mrtk.core/Editor/EditorProjectUtilities.cs +++ b/com.microsoft.mrtk.core/Editor/EditorProjectUtilities.cs @@ -5,6 +5,9 @@ namespace Microsoft.MixedReality.Toolkit.Editor { + /// + /// Static class containing helpers for a Unity editor project. + /// [InitializeOnLoad] public static class EditorProjectUtilities { diff --git a/com.microsoft.mrtk.core/Editor/Editors/BaseInteractableEditor.cs b/com.microsoft.mrtk.core/Editor/Editors/BaseInteractableEditor.cs index 0b478c473ae..68f002b21f7 100644 --- a/com.microsoft.mrtk.core/Editor/Editors/BaseInteractableEditor.cs +++ b/com.microsoft.mrtk.core/Editor/Editors/BaseInteractableEditor.cs @@ -8,6 +8,9 @@ namespace Microsoft.MixedReality.Toolkit.Editor { + /// + /// A base class for custom editors. + /// [CustomEditor(typeof(MRTKBaseInteractable), true)] public class BaseInteractableEditor : XRBaseInteractableEditor { @@ -61,17 +64,18 @@ protected SerializedProperty SetUpProperty(string serializedFieldName) } /// - /// Sets up a serialized property based on the name of the autoproperty with an - /// implicitly-defindd backing serialized field. + /// Sets up a serialized property based on the name of the auto property with an + /// implicitly defined backing serialized field. /// /// /// - protected SerializedProperty SetUpAutoProp(string autoPropName) + protected SerializedProperty SetUpAutoProperty(string autoPropName) { string backingField = InspectorUIUtility.GetBackingField(autoPropName); return SetUpProperty(backingField); } + /// protected override List GetDerivedSerializedPropertyNames() { var propNames = base.GetDerivedSerializedPropertyNames(); @@ -81,6 +85,7 @@ protected override List GetDerivedSerializedPropertyNames() static bool xriBaseFoldout = false; + /// protected override void DrawProperties() { xriBaseFoldout = EditorGUILayout.Foldout(xriBaseFoldout, EditorGUIUtility.TrTempContent("Base XRI Settings"), true, EditorStyles.foldoutHeader); @@ -93,6 +98,7 @@ protected override void DrawProperties() } } + /// protected override void DrawInteractableEvents() { EditorGUILayout.PropertyField(disabledInteractorTypes); @@ -112,6 +118,9 @@ protected override void DrawInteractableEvents() } } + /// + /// Draw the serialized flags fields from the object. + /// protected virtual void DrawMRTKInteractableFlags() { Color previousGUIColor = GUI.color; @@ -144,6 +153,9 @@ protected virtual void DrawMRTKInteractableFlags() } } + /// + /// Draw a field. + /// protected void DrawTimedFlag(SerializedProperty property, TimedFlag timedFlag, Color previousColor, Color activeColor) { GUI.color = previousColor; diff --git a/com.microsoft.mrtk.core/Editor/Editors/MRTKProfileEditor.cs b/com.microsoft.mrtk.core/Editor/Editors/MRTKProfileEditor.cs index 5bcb20a4ec3..99c515f81de 100644 --- a/com.microsoft.mrtk.core/Editor/Editors/MRTKProfileEditor.cs +++ b/com.microsoft.mrtk.core/Editor/Editors/MRTKProfileEditor.cs @@ -64,12 +64,12 @@ public SubsystemItem(Type type) /// /// The serialized type reference to the concrete subsystem type. - /// Generated with + /// Generated with /// public readonly string Reference; /// - /// The of the least-derived configuration + /// The of the least-derived configuration /// class that is compatible with this subsystem. /// /// @@ -220,6 +220,9 @@ private void OnEnable() serializedConfigs = serializedObject.FindProperty("subsystemConfigs"); } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { if (serializedObject == null || serializedObject.targetObject == null) diff --git a/com.microsoft.mrtk.core/Editor/Editors/MRTKSettingsEditor.cs b/com.microsoft.mrtk.core/Editor/Editors/MRTKSettingsEditor.cs index 2a830177237..f4b52d8a906 100644 --- a/com.microsoft.mrtk.core/Editor/Editors/MRTKSettingsEditor.cs +++ b/com.microsoft.mrtk.core/Editor/Editors/MRTKSettingsEditor.cs @@ -35,6 +35,9 @@ private void OnEnable() profileDict = serializedObject.FindProperty("settings"); } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { if (serializedObject == null || serializedObject.targetObject == null) diff --git a/com.microsoft.mrtk.core/Editor/Editors/StatefulInteractableEditor.cs b/com.microsoft.mrtk.core/Editor/Editors/StatefulInteractableEditor.cs index be8cdc2d263..735cf3a4363 100644 --- a/com.microsoft.mrtk.core/Editor/Editors/StatefulInteractableEditor.cs +++ b/com.microsoft.mrtk.core/Editor/Editors/StatefulInteractableEditor.cs @@ -6,6 +6,9 @@ namespace Microsoft.MixedReality.Toolkit.Editor { + /// + /// A custom editor for the class. + /// [CustomEditor(typeof(StatefulInteractable), true)] [CanEditMultipleObjects] public class StatefulInteractableEditor : BaseInteractableEditor @@ -26,7 +29,7 @@ public class StatefulInteractableEditor : BaseInteractableEditor private SerializedProperty FarDwellTime; private SerializedProperty OnClicked; private SerializedProperty OnToggled; - private SerializedProperty OnDetoggled; + private SerializedProperty OnUntoggled; private SerializedProperty OnEnabled; private SerializedProperty OnDisabled; private static bool advancedFoldout = false; @@ -39,46 +42,49 @@ protected override void OnEnable() { base.OnEnable(); - IsToggled = SetUpAutoProp(nameof(IsToggled)); + IsToggled = SetUpAutoProperty(nameof(IsToggled)); IsToggledStateActive = IsToggled.FindPropertyRelative("active"); - SelectThreshold = SetUpAutoProp(nameof(SelectThreshold)); - DeselectThreshold = SetUpAutoProp(nameof(DeselectThreshold)); + SelectThreshold = SetUpAutoProperty(nameof(SelectThreshold)); + DeselectThreshold = SetUpAutoProperty(nameof(DeselectThreshold)); - ToggleMode = SetUpAutoProp(nameof(ToggleMode)); - TriggerOnRelease = SetUpAutoProp(nameof(TriggerOnRelease)); + ToggleMode = SetUpAutoProperty(nameof(ToggleMode)); + TriggerOnRelease = SetUpAutoProperty(nameof(TriggerOnRelease)); allowSelectByVoice = SetUpProperty(nameof(allowSelectByVoice)); speechRecognitionKeyword = SetUpProperty(nameof(speechRecognitionKeyword)); - VoiceRequiresFocus = SetUpAutoProp(nameof(VoiceRequiresFocus)); + VoiceRequiresFocus = SetUpAutoProperty(nameof(VoiceRequiresFocus)); - SelectRequiresHover = SetUpAutoProp(nameof(SelectRequiresHover)); + SelectRequiresHover = SetUpAutoProperty(nameof(SelectRequiresHover)); - UseGazeDwell = SetUpAutoProp(nameof(UseGazeDwell)); - GazeDwellTime = SetUpAutoProp(nameof(GazeDwellTime)); - UseFarDwell = SetUpAutoProp(nameof(UseFarDwell)); - FarDwellTime = SetUpAutoProp(nameof(FarDwellTime)); + UseGazeDwell = SetUpAutoProperty(nameof(UseGazeDwell)); + GazeDwellTime = SetUpAutoProperty(nameof(GazeDwellTime)); + UseFarDwell = SetUpAutoProperty(nameof(UseFarDwell)); + FarDwellTime = SetUpAutoProperty(nameof(FarDwellTime)); - OnClicked = SetUpAutoProp(nameof(OnClicked)); + OnClicked = SetUpAutoProperty(nameof(OnClicked)); - OnEnabled = SetUpAutoProp(nameof(OnEnabled)); - OnDisabled = SetUpAutoProp(nameof(OnDisabled)); + OnEnabled = SetUpAutoProperty(nameof(OnEnabled)); + OnDisabled = SetUpAutoProperty(nameof(OnDisabled)); - // OnToggle/Detoggle aliases to IsToggled.OnEntered/IsToggled.OnExited + // OnToggled and OnUntoggled aliases to IsToggled.OnEntered and IsToggled.OnExited OnToggled = IsToggled.FindPropertyRelative("onEntered"); - OnDetoggled = IsToggled.FindPropertyRelative("onExited"); + OnUntoggled = IsToggled.FindPropertyRelative("onExited"); } + /// protected override void DrawProperties() { DrawProperties(true); } /// - /// Overload to to allow subclasses to specify whether they'd like - /// to show toggle-related properties. Some subclasses hide this, - /// as showing toggle settings wouldn't make much sense for their use case. + /// Overload to to allow subclasses to specify whether they'd like + /// to show toggle-related properties. /// + /// + /// Some subclasses hide this, as showing toggle settings wouldn't make much sense for their use case. + /// protected void DrawProperties(bool showToggleMode) { EditorGUILayout.Space(); @@ -123,7 +129,7 @@ protected void DrawProperties(bool showToggleMode) if ((StatefulInteractable.ToggleType)ToggleMode.intValue != StatefulInteractable.ToggleType.Button) { EditorGUILayout.PropertyField(OnToggled, new GUIContent("On Toggled", "Fired when the toggle state has changed from false to true.")); - EditorGUILayout.PropertyField(OnDetoggled, new GUIContent("On Detoggled", "Fired when the toggle state has changed from true to false.")); + EditorGUILayout.PropertyField(OnUntoggled, new GUIContent("On Untoggled", "Fired when the toggle state has changed from true to false.")); } } @@ -173,6 +179,9 @@ protected void DrawProperties(bool showToggleMode) serializedObject.ApplyModifiedProperties(); } + /// + /// Draw the serialized flags fields from the object. + /// protected override void DrawMRTKInteractableFlags() { Color previousGUIColor = GUI.color; diff --git a/com.microsoft.mrtk.core/Editor/MRTKBuildProcessor.cs b/com.microsoft.mrtk.core/Editor/MRTKBuildProcessor.cs index 8402046c24e..fb1ffe9f7b2 100644 --- a/com.microsoft.mrtk.core/Editor/MRTKBuildProcessor.cs +++ b/com.microsoft.mrtk.core/Editor/MRTKBuildProcessor.cs @@ -11,7 +11,7 @@ namespace Microsoft.MixedReality.Toolkit.Editor { /// - /// Custom build processor that determines the correct to bundle + /// Custom build processor that determines the correct to bundle /// with the build assets. /// internal class MRTKBuildProcessor : IPreprocessBuildWithReport, IPostprocessBuildWithReport diff --git a/com.microsoft.mrtk.core/Editor/MRTKProjectValidation.cs b/com.microsoft.mrtk.core/Editor/MRTKProjectValidation.cs index 037ccf605ec..03f703e34ee 100644 --- a/com.microsoft.mrtk.core/Editor/MRTKProjectValidation.cs +++ b/com.microsoft.mrtk.core/Editor/MRTKProjectValidation.cs @@ -26,6 +26,12 @@ public static class MRTKProjectValidation private const string DefaultMRTKProfileGuid = "c677e5c4eb85b7849a8da406775c299d"; private static readonly Dictionary> validationRulesDictionary = new Dictionary>(); + /// + /// Get all the possible enumeration values. + /// + /// + /// Build targets currently not supported by MRTK will be filtered out. + /// public static readonly BuildTargetGroup[] BuildTargetGroups = ((BuildTargetGroup[])Enum.GetValues(typeof(BuildTargetGroup))).Distinct().Except(excludedBuildTargetGroups).ToArray(); [MenuItem("Mixed Reality/MRTK3/Utilities/Project Validation", priority = 0)] diff --git a/com.microsoft.mrtk.core/Editor/MRTKSettings.cs b/com.microsoft.mrtk.core/Editor/MRTKSettings.cs index d24f23680a1..3f186903979 100644 --- a/com.microsoft.mrtk.core/Editor/MRTKSettings.cs +++ b/com.microsoft.mrtk.core/Editor/MRTKSettings.cs @@ -7,11 +7,11 @@ namespace Microsoft.MixedReality.Toolkit.Editor { - [InitializeOnLoad] - [System.Serializable] /// /// Root settings class that holds a mapping of build target groups to profiles. /// + [InitializeOnLoad] + [System.Serializable] public class MRTKSettings : ScriptableObject { internal const string MRTKGeneratedFolder = "Assets/MRTK.Generated"; @@ -61,10 +61,12 @@ public MRTKProfile GetProfileForBuildTarget(BuildTargetGroup targetGroup) /// /// Static method to obtain the profile for a given build target group, - /// retrieved from . + /// retrieved from . /// /// An enum specifying which platform group this build is for. - /// The instance of assigned to the key, or null if not. + /// + /// The instance of assigned to the key, or if not. + /// public static MRTKProfile ProfileForBuildTarget(BuildTargetGroup targetGroup) { MRTKSettings buildTargetSettings = GetOrCreateSettings(); diff --git a/com.microsoft.mrtk.core/Editor/PropertyDrawers/DrawIfPropertyDrawer.cs b/com.microsoft.mrtk.core/Editor/PropertyDrawers/DrawIfPropertyDrawer.cs index 90ab04d5321..d3fdceee860 100644 --- a/com.microsoft.mrtk.core/Editor/PropertyDrawers/DrawIfPropertyDrawer.cs +++ b/com.microsoft.mrtk.core/Editor/PropertyDrawers/DrawIfPropertyDrawer.cs @@ -7,15 +7,17 @@ namespace Microsoft.MixedReality.Toolkit { /// - /// Conditionally draws a property based on the value associated - /// with the attribute. + /// A custom property drawer for fields decorated with the attribute. /// /// - /// Based on: https://forum.unity.com/threads/draw-a-field-only-if-a-condition-is-met.448855/ + /// Conditionally draws a property based on the value associated + /// with the attribute. /// [CustomPropertyDrawer(typeof(DrawIfAttribute))] public class DrawIfPropertyDrawer : PropertyDrawer { + // Based on: https://forum.unity.com/threads/draw-a-field-only-if-a-condition-is-met.448855/ + /// public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { diff --git a/com.microsoft.mrtk.core/Editor/PropertyDrawers/ExperimentalDrawer.cs b/com.microsoft.mrtk.core/Editor/PropertyDrawers/ExperimentalDrawer.cs index be6878707c5..b459f59d604 100644 --- a/com.microsoft.mrtk.core/Editor/PropertyDrawers/ExperimentalDrawer.cs +++ b/com.microsoft.mrtk.core/Editor/PropertyDrawers/ExperimentalDrawer.cs @@ -13,7 +13,7 @@ namespace Microsoft.MixedReality.Toolkit.Editor public class ExperimentalDrawer : DecoratorDrawer { /// - /// Unity calls this function to draw the GUI. + /// A function called by Unity to render and handle GUI events. /// /// Rectangle to display the GUI in public override void OnGUI(Rect position) diff --git a/com.microsoft.mrtk.core/Editor/PropertyDrawers/InterfaceSelectorDrawer.cs b/com.microsoft.mrtk.core/Editor/PropertyDrawers/InterfaceSelectorDrawer.cs index 838f72540d4..76ae133ccae 100644 --- a/com.microsoft.mrtk.core/Editor/PropertyDrawers/InterfaceSelectorDrawer.cs +++ b/com.microsoft.mrtk.core/Editor/PropertyDrawers/InterfaceSelectorDrawer.cs @@ -9,12 +9,18 @@ namespace Microsoft.MixedReality.Toolkit.Editor { + /// + /// A custom property drawer for fields decorated with the attribute. + /// [CustomPropertyDrawer(typeof(InterfaceSelectorAttribute))] public class InterfaceSelectorDrawer : PropertyDrawer { private GUIContent dropLabel; private GUIStyle labelStyle; + /// + /// Initializes a new instance of the class. + /// public InterfaceSelectorDrawer() { // Cache some items used frequently in OnGUI @@ -24,9 +30,11 @@ public InterfaceSelectorDrawer() dropLabel.tooltip = "This will search the project for classes that match this property's interface, and create an instance of that class."; } + /// public override float GetPropertyHeight(SerializedProperty property, GUIContent label) => EditorGUI.GetPropertyHeight(property, true); + /// public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); diff --git a/com.microsoft.mrtk.core/Editor/PropertyDrawers/LabelWidthAttributeDrawer.cs b/com.microsoft.mrtk.core/Editor/PropertyDrawers/LabelWidthAttributeDrawer.cs index 489a3811ca1..0b54db3b2b8 100644 --- a/com.microsoft.mrtk.core/Editor/PropertyDrawers/LabelWidthAttributeDrawer.cs +++ b/com.microsoft.mrtk.core/Editor/PropertyDrawers/LabelWidthAttributeDrawer.cs @@ -6,9 +6,13 @@ namespace Microsoft.MixedReality.Toolkit.Editor { + /// + /// A custom property drawer for fields decorated with the attribute. + /// [CustomPropertyDrawer(typeof(LabelWidthAttribute))] internal class LabelWidthAttributeDrawer : PropertyDrawer { + /// public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { LabelWidthAttribute labelWidthAttribute = attribute as LabelWidthAttribute; diff --git a/com.microsoft.mrtk.core/Editor/PropertyDrawers/SelectRepairedTypeWindow.cs b/com.microsoft.mrtk.core/Editor/PropertyDrawers/SelectRepairedTypeWindow.cs index e6582e43f3c..bdb2bcf6f45 100644 --- a/com.microsoft.mrtk.core/Editor/PropertyDrawers/SelectRepairedTypeWindow.cs +++ b/com.microsoft.mrtk.core/Editor/PropertyDrawers/SelectRepairedTypeWindow.cs @@ -7,14 +7,29 @@ namespace Microsoft.MixedReality.Toolkit.Editor { + /// + /// A Unity editor window for repairing field serializations. + /// public class SelectRepairedTypeWindow : EditorWindow { private static Type[] repairedTypeOptions; private static SerializedProperty property; private static SelectRepairedTypeWindow window; - public static bool WindowOpen { get { return window != null; } } + /// + /// Get if a window is opened. + /// + public static bool WindowOpen + { + get =>? window != null; + } + /// + /// Create and open a new window. + /// + /// + /// Closes a previously opened window. + /// public static void Display(Type[] repairedTypeOptions, SerializedProperty property) { if (window != null) @@ -30,6 +45,9 @@ public static void Display(Type[] repairedTypeOptions, SerializedProperty proper window.ShowUtility(); } + /// + /// A function called by Unity to render and handle GUI events. + /// private void OnGUI() { for (int i = 0; i < repairedTypeOptions.Length; i++) diff --git a/com.microsoft.mrtk.core/Editor/PropertyDrawers/TimedFlagPropertyDrawer.cs b/com.microsoft.mrtk.core/Editor/PropertyDrawers/TimedFlagPropertyDrawer.cs index 2e5fa63922c..f500a4f515a 100644 --- a/com.microsoft.mrtk.core/Editor/PropertyDrawers/TimedFlagPropertyDrawer.cs +++ b/com.microsoft.mrtk.core/Editor/PropertyDrawers/TimedFlagPropertyDrawer.cs @@ -7,16 +7,19 @@ namespace Microsoft.MixedReality.Toolkit.Editor { /// - /// Custom property drawer for properties. - /// Enables inspector-editing of state value if the property is decorated - /// with . + /// A custom property drawer for fields. /// + /// + /// Enables inspector editing of state value if the property is decorated + /// with . + /// [CustomPropertyDrawer(typeof(TimedFlag), true)] [CustomPropertyDrawer(typeof(EditableTimedFlagAttribute), true)] public class TimedFlagPropertyDrawer : PropertyDrawer { bool foldout = false; + /// public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { if (foldout = EditorGUILayout.Foldout(foldout, label, true)) @@ -30,6 +33,7 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten } } + /// public override float GetPropertyHeight(SerializedProperty property, GUIContent label) => 0; } } \ No newline at end of file diff --git a/com.microsoft.mrtk.core/Editor/PropertyDrawers/TypeReferencePropertyDrawer.cs b/com.microsoft.mrtk.core/Editor/PropertyDrawers/TypeReferencePropertyDrawer.cs index 930012095ee..8d0fa162299 100644 --- a/com.microsoft.mrtk.core/Editor/PropertyDrawers/TypeReferencePropertyDrawer.cs +++ b/com.microsoft.mrtk.core/Editor/PropertyDrawers/TypeReferencePropertyDrawer.cs @@ -10,7 +10,7 @@ namespace Microsoft.MixedReality.Toolkit.Editor { /// - /// Custom property drawer for properties. + /// Custom property drawer for properties. /// [CustomPropertyDrawer(typeof(SystemType))] [CustomPropertyDrawer(typeof(SystemTypeAttribute), true)] @@ -351,11 +351,13 @@ private static void OnSelectedTypeName(object userData) #endregion Control Drawing / Event Handling + /// public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { return EditorStyles.popup.CalcHeight(GUIContent.none, 0); } + /// public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { DrawTypeSelectionControl(position, property.FindPropertyRelative("reference"), label, attribute as SystemTypeAttribute); diff --git a/com.microsoft.mrtk.core/Editor/PropertyDrawers/VariableRangeAttributeDrawer.cs b/com.microsoft.mrtk.core/Editor/PropertyDrawers/VariableRangeAttributeDrawer.cs index efd5843b821..075ad490867 100644 --- a/com.microsoft.mrtk.core/Editor/PropertyDrawers/VariableRangeAttributeDrawer.cs +++ b/com.microsoft.mrtk.core/Editor/PropertyDrawers/VariableRangeAttributeDrawer.cs @@ -6,16 +6,23 @@ namespace Microsoft.MixedReality.Toolkit.Editor { + /// + /// A custom property drawer for fields decorated with the attribute. + /// [CustomPropertyDrawer(typeof(VariableRangeAttribute))] public class VariableRangePropertyDrawer : PropertyDrawer { private GUIStyle labelStyle; + /// + /// Initializes a new instance of the class. + /// public VariableRangePropertyDrawer() { labelStyle = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector).label; } + /// public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); diff --git a/com.microsoft.mrtk.core/Editor/Utilities/GUIEnabledWrapper.cs b/com.microsoft.mrtk.core/Editor/Utilities/GUIEnabledWrapper.cs index 04f295343f0..5d21490b163 100644 --- a/com.microsoft.mrtk.core/Editor/Utilities/GUIEnabledWrapper.cs +++ b/com.microsoft.mrtk.core/Editor/Utilities/GUIEnabledWrapper.cs @@ -7,10 +7,16 @@ namespace Microsoft.MixedReality.Toolkit.Editor { /// - /// Similar to the scope classes in Unity (i.e VerticalScope), - /// This class is a helper class designed to force enable GUI.enabled over some lifetime. - /// Should be utilized with using{} code block. + /// A helper class designed to force enable over some lifetime. /// + /// + /// + /// This should be utilized within a code block. + /// + /// + /// This class is similar to the scope classes in Unity, like . + /// + /// public class GUIEnabledWrapper : IDisposable { private readonly bool wasGUIEnabled; @@ -24,6 +30,9 @@ public GUIEnabledWrapper() GUI.enabled = true; } + /// + /// Reset the previous state of , before this class was initialized. + /// public void Dispose() { // Dispose of unmanaged resources. @@ -32,6 +41,9 @@ public void Dispose() GC.SuppressFinalize(this); } + /// + /// Reset the previous state of , before this class was initialized. + /// protected virtual void Dispose(bool disposing) { GUI.enabled = wasGUIEnabled; diff --git a/com.microsoft.mrtk.core/Editor/Utilities/InspectorUIUtility.cs b/com.microsoft.mrtk.core/Editor/Utilities/InspectorUIUtility.cs index cfd4799466c..74fcf0dbf71 100644 --- a/com.microsoft.mrtk.core/Editor/Utilities/InspectorUIUtility.cs +++ b/com.microsoft.mrtk.core/Editor/Utilities/InspectorUIUtility.cs @@ -40,61 +40,227 @@ public static class InspectorUIUtility private static readonly Color ProfessionalThemeColorTint25 = new Color(0.75f, 0.75f, 0.75f); private static readonly Color ProfessionalThemeColorTint10 = new Color(0.9f, 0.9f, 0.9f); + /// + /// A color based on the Unity theme color at a 100% tint. + /// + /// + /// The Unity theme color is based on whether the user is using a Unity Pro license. + /// public static Color ColorTint100 => EditorGUIUtility.isProSkin ? ProfessionalThemeColorTint100 : PersonalThemeColorTint100; + + /// + /// A color based on the Unity theme color at a 75% tint. + /// + /// + /// The Unity theme color is based on whether the user is using a Unity Pro license. + /// public static Color ColorTint75 => EditorGUIUtility.isProSkin ? ProfessionalThemeColorTint75 : PersonalThemeColorTint75; + + /// + /// A color based on the Unity theme color at a 50% tint. + /// + /// + /// The Unity theme color is based on whether the user is using a Unity Pro license. + /// public static Color ColorTint50 => EditorGUIUtility.isProSkin ? ProfessionalThemeColorTint50 : PersonalThemeColorTint50; + + /// + /// A color based on the Unity theme color at a 25% tint. + /// + /// + /// The Unity theme color is based on whether the user is using a Unity Pro license. + /// public static Color ColorTint25 => EditorGUIUtility.isProSkin ? ProfessionalThemeColorTint25 : PersonalThemeColorTint25; + + /// + /// A color based on the Unity theme color at a 10% tint. + /// + /// + /// The Unity theme color is based on whether the user is using a Unity Pro license. + /// public static Color ColorTint10 => EditorGUIUtility.isProSkin ? ProfessionalThemeColorTint10 : PersonalThemeColorTint10; + /// + /// A color to use for disabled elements in custom editor UI. + /// public static readonly Color DisabledColor = new Color(0.6f, 0.6f, 0.6f); + + /// + /// A color to use for warning elements in custom editor UI. + /// public static readonly Color WarningColor = new Color(1f, 0.85f, 0.6f); + + /// + /// A color to use for error elements in custom editor UI. + /// public static readonly Color ErrorColor = new Color(1f, 0.55f, 0.5f); + + /// + /// A color to use for success elements in custom editor UI. + /// public static readonly Color SuccessColor = new Color(0.8f, 1f, 0.75f); + + /// + /// A color to use for selected elements in custom editor UI. + /// public static readonly Color SectionColor = new Color(0.85f, 0.9f, 1f); + + /// + /// A color to use for dark elements in custom editor UI. + /// public static readonly Color DarkColor = new Color(0.1f, 0.1f, 0.1f); + + /// + /// A color to use for square handle elements in custom editor UI. + /// public static readonly Color HandleColorSquare = new Color(0.0f, 0.9f, 1f); + + /// + /// A color to use for circle handle elements in custom editor UI. + /// public static readonly Color HandleColorCircle = new Color(1f, 0.5f, 1f); + + /// + /// A color to use for sphere handle elements in custom editor UI. + /// public static readonly Color HandleColorSphere = new Color(1f, 0.5f, 1f); + + /// + /// A color to use for axis handle elements in custom editor UI. + /// public static readonly Color HandleColorAxis = new Color(0.0f, 1f, 0.2f); + + /// + /// A color to use for rotation handle elements in custom editor UI. + /// public static readonly Color HandleColorRotation = new Color(0.0f, 1f, 0.2f); + + /// + /// A color to use for tangent handle elements in custom editor UI. + /// public static readonly Color HandleColorTangent = new Color(0.1f, 0.8f, 0.5f, 0.7f); + + /// + /// A color to use for line velocity elements in custom editor UI. + /// public static readonly Color LineVelocityColor = new Color(0.9f, 1f, 0f, 0.8f); #endregion Color #region Sizes - // default UI sizes + /// + /// The default font size for title elements in custom editor UI. + /// public const int TitleFontSize = 14; + + /// + /// The default font size for header elements in custom editor UI. + /// public const int HeaderFontSize = 11; + + /// + /// The default font size for text elements in custom editor UI. + /// public const int DefaultFontSize = 10; + + /// + /// The default width of documentation link elements in custom editor UI. + /// public const float DocLinkWidth = 175f; #endregion Sizes #region Special unicode characters - // special characters + /// + /// The unicode value for the 'minus sign' character. + /// public static readonly string Minus = "\u2212"; + + /// + /// The unicode value for the 'plus sign' character. + /// public static readonly string Plus = "\u002B"; + + /// + /// The unicode value for the 'asterisk operator' character. + /// public static readonly string Asterisk = "\u2217"; + + /// + /// The unicode value for the 'left arrowhead' character. + /// public static readonly string Left = "\u02C2"; + + /// + /// The unicode value for the 'right arrowhead' character. + /// public static readonly string Right = "\u02C3"; + + /// + /// The unicode value for the 'up arrowhead' character. + /// public static readonly string Up = "\u02C4"; + + /// + /// The unicode value for the 'down arrowhead' character. + /// public static readonly string Down = "\u02C5"; + + /// + /// The unicode value for the 'multiplication x' character. + /// + /// + /// The 'multiplication x' character also represents a 'close' icon in MRTK. + /// public static readonly string Close = "\u2715"; + + /// + /// The unicode value for the 'heart suit' character. + /// public static readonly string Heart = "\u2661"; + + /// + /// The unicode value for the 'star' character. + /// public static readonly string Star = "\u2606"; + + /// + /// The unicode value for the 'smiling face' character. + /// public static readonly string Emoji = "\u263A"; + + /// + /// The unicode value for the 'clockwise open circle arrow' character. + /// + /// + /// The 'clockwise open circle arrow' character also represents a 'reload' icon in MRTK. + /// public static readonly string Reload = "\u21BB"; #endregion Special unicode characters #region Handy icon textures + /// + /// A Unity representing a 'help' icon. + /// public static readonly Texture HelpIcon = EditorGUIUtility.IconContent("_Help").image; + + /// + /// A Unity representing a 'success' icon. + /// public static readonly Texture SuccessIcon = EditorGUIUtility.IconContent("Collab").image; + + /// + /// A Unity representing a 'warning' icon. + /// public static readonly Texture WarningIcon = EditorGUIUtility.IconContent("console.warnicon").image; + + /// + /// A Unity representing a 'information' icon. + /// public static readonly Texture InfoIcon = EditorGUIUtility.IconContent("console.infoicon").image; // StandardAssets/Textures/MRTK_Logo_Black.png @@ -103,25 +269,20 @@ public static class InspectorUIUtility // StandardAssets/Textures/MRTK_Logo_White.png private const string LogoDarkThemeGuid = "fe5cc215f12ea5e40b5021c4040bce24"; - /// MRTK Logo texture suitable for light theme. + /// + /// The MRTK logo texture suitable for a light theme. + /// public static readonly Texture2D LogoLightTheme = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(LogoLightThemeGuid)); - /// MRTK Logo texture suitable for light theme. + /// + /// The MRTK logo texture suitable for a dark theme. + /// public static readonly Texture2D LogoDarkTheme = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(LogoDarkThemeGuid)); #endregion Handy icon textures #region Handy drawables/controls - /// - /// A data container for managing scrolling lists or nested drawers in custom inspectors. - /// - public struct ListSettings - { - public bool Show; - public Vector2 Scroll; - } - /// /// Delegate for button callbacks, single index /// @@ -205,10 +366,13 @@ public static bool RenderIndentedButton(Func renderButton) } /// - /// Render documentation button routing to relevant URI + /// Render documentation button routing to relevant URI. /// - /// documentation URL to open on button click - /// if button clicked, otherwise. + /// The documentation URL to open on button click. + /// The width of the documentation link button. + /// + /// if button clicked, otherwise. + /// public static bool RenderDocumentationButton(string docURL, float width = DocLinkWidth) { if (!string.IsNullOrEmpty(docURL)) @@ -380,15 +544,23 @@ public static bool FullWidthButton(GUIContent label, float padding, int[] indexA } /// - /// A small button, good for a single icon like + or - with single index callback events + /// A small editor button. /// - /// content to place in the button - /// if button selected, otherwise. - public static bool SmallButton(GUIContent label, int index, ListButtonEvent callback, SerializedProperty prop = null) + /// + /// This is good for a single icon, like a 'plus sign' or 'minus sign', with a single index callback event. + /// + /// The content to place in the button. + /// The index to pass into the when the editor button is clicked. + /// A delegate callback to invoke when the button is clicked. + /// The to pass into the when the editor button is clicked. + /// + /// if button selected, otherwise. + /// + public static bool SmallButton(GUIContent label, int index, ListButtonEvent callback, SerializedProperty property = null) { if (SmallButton(label)) { - callback(index, prop); + callback(index, property); return true; } @@ -396,15 +568,23 @@ public static bool SmallButton(GUIContent label, int index, ListButtonEvent call } /// - /// A small button, good for a single icon like + or - with multi-index callback events + /// A small editor button. /// - /// content to place in the button - /// if button selected, otherwise. - public static bool SmallButton(GUIContent label, int[] indexArr, MultiListButtonEvent callback, SerializedProperty prop = null) + /// + /// This is good for a single icon, like a 'plus sign' or 'minus sign', with a multiple-indices callback event. + /// + /// The content to place in the button. + /// The indices to pass into the when the editor button is clicked. + /// A delegate callback to invoke when the button is clicked. + /// The to pass into the when the editor button is clicked. + /// + /// if button selected, otherwise. + /// + public static bool SmallButton(GUIContent label, int[] indices, MultiListButtonEvent callback, SerializedProperty property = null) { if (SmallButton(label)) { - callback(indexArr, prop); + callback(indices, property); return true; } @@ -412,10 +592,15 @@ public static bool SmallButton(GUIContent label, int[] indexArr, MultiListButton } /// - /// A small button, good for a single icon like + or - + /// A small editor button. /// - /// content to place in the button - /// if button selected, otherwise. + /// + /// This is good for a single icon, like a 'plus sign' or 'minus sign'. + /// + /// The content to place in the button. + /// + /// if button selected, otherwise. + /// public static bool SmallButton(GUIContent label) { GUIStyle smallButton = new GUIStyle(EditorStyles.miniButton); @@ -430,8 +615,9 @@ public static bool SmallButton(GUIContent label) } /// - /// Large title format + /// Large title format. /// + /// The content to render. public static void DrawTitle(string title) { GUIStyle labelStyle = MRTKEditorStyles.LabelStyle(TitleFontSize, ColorTint50); @@ -440,9 +626,9 @@ public static void DrawTitle(string title) } /// - /// Medium title format + /// Medium title format. /// - /// string content to render + /// The content to render. public static void DrawHeader(string header) { GUIStyle labelStyle = MRTKEditorStyles.LabelStyle(HeaderFontSize, ColorTint10); @@ -450,8 +636,11 @@ public static void DrawHeader(string header) } /// - /// Draw a basic label + /// Draw a basic label. /// + /// The content to render. + /// The label size. + /// The label color. public static void DrawLabel(string title, int size, Color color) { GUIStyle labelStyle = MRTKEditorStyles.LabelStyle(size, color); @@ -459,8 +648,9 @@ public static void DrawLabel(string title, int size, Color color) } /// - /// draw a label with a yellow coloring + /// Draw a label with a yellow warning color. /// + /// The content to render. public static void DrawWarning(string warning) { Color prevColor = GUI.color; @@ -474,8 +664,9 @@ public static void DrawWarning(string warning) } /// - /// draw a notice area, normal coloring + /// Draw a notice area, normal coloring. /// + /// The content to render. public static void DrawNotice(string notice) { Color prevColor = GUI.color; @@ -490,8 +681,9 @@ public static void DrawNotice(string notice) } /// - /// draw a notice with green coloring + /// Draw a notice with green success color. /// + /// The content to render. public static void DrawSuccess(string notice) { Color prevColor = GUI.color; @@ -505,8 +697,9 @@ public static void DrawSuccess(string notice) } /// - /// draw a notice with red coloring + /// Draw a notice with red error coloring. /// + /// The content to render. public static void DrawError(string error) { Color prevColor = GUI.color; @@ -520,7 +713,7 @@ public static void DrawError(string error) } /// - /// Create a line across the negative space + /// Create a line across the negative space. /// public static void DrawDivider() { @@ -528,7 +721,7 @@ public static void DrawDivider() } /// - /// Draws a section start (initiated by the Header attribute) + /// Draws a start section start. /// public static bool DrawSectionFoldout(string headerName, bool open = true, GUIStyle style = null) { @@ -539,8 +732,10 @@ public static bool DrawSectionFoldout(string headerName, bool open = true, GUISt return EditorGUILayout.Foldout(open, headerName, true, style); } } + /// - /// Draws a section start with header name and save open/close state to given preference key in SessionState + /// Draws a section start with header name and save the open and close state to given + /// preference key in a . /// public static bool DrawSectionFoldoutWithKey(string headerName, string preferenceKey = null, GUIStyle style = null, bool defaultOpen = true) { @@ -555,34 +750,32 @@ public static bool DrawSectionFoldoutWithKey(string headerName, string preferenc } /// - /// Draws a popup UI with PropertyField type features. - /// Displays prefab pending updates + /// Draws a popup UI with type features. /// - /// serialized property corresponding to Enum - /// label for property - /// Current enum value for property - /// New enum value after draw - public static Enum DrawEnumSerializedProperty(SerializedProperty prop, GUIContent label, Enum propValue) + /// The serialized property corresponding to the . + /// The label for the property. + /// Current enumeration value for the property. + /// New enumeration value after draw. + public static Enum DrawEnumSerializedProperty(SerializedProperty property, GUIContent label, Enum propertyValue) { - return DrawEnumSerializedProperty(EditorGUILayout.GetControlRect(), prop, label, propValue); + return DrawEnumSerializedProperty(EditorGUILayout.GetControlRect(), property, label, propertyValue); } /// - /// Draws a popup UI with PropertyField type features. - /// Displays prefab pending updates + /// Draws a popup UI with type features. /// - /// position to render the serialized property - /// serialized property corresponding to Enum - /// label for property - /// Current enum value for property - /// New enum value after draw - public static Enum DrawEnumSerializedProperty(Rect position, SerializedProperty prop, GUIContent label, Enum propValue) + /// The position to render the serialized property. + /// serialized property corresponding to . + /// The label for the property. + /// Current enumeration value for the property. + /// New enumeration value after draw. + public static Enum DrawEnumSerializedProperty(Rect position, SerializedProperty property, GUIContent label, Enum propertyValue) { - Enum result = propValue; - EditorGUI.BeginProperty(position, label, prop); + Enum result = propertyValue; + EditorGUI.BeginProperty(position, label, property); { - result = EditorGUI.EnumPopup(position, label, propValue); - prop.intValue = Convert.ToInt32(result); + result = EditorGUI.EnumPopup(position, label, propertyValue); + property.intValue = Convert.ToInt32(result); } EditorGUI.EndProperty(); @@ -590,9 +783,11 @@ public static Enum DrawEnumSerializedProperty(Rect position, SerializedProperty } /// - /// Draws a foldout enlisting all components (or derived types) of the given type attached to the passed GameObject. - /// Adds a button for adding any of the component (or derived types) and a follow button to highlight existing attached components. + /// Draws a foldout enlisting all components, or derived types, of the given type attached to the passed . /// + /// + /// This adds a button for adding any of the component, or derived types, and a follow button to highlight existing attached components. + /// public static bool DrawComponentTypeFoldout(GameObject gameObject, bool isExpanded, string typeDescription) where T : MonoBehaviour { isExpanded = EditorGUILayout.Foldout(isExpanded, typeDescription + "s", true); @@ -654,13 +849,18 @@ static private void DrawScriptableSubEditor(SerializedProperty scriptable) #region Utilities + /// + /// Obtain the name for an field which is capable of holding a value for the given property. + /// + /// The name of a property. public static string GetBackingField(string propertyName) => $"<{propertyName}>k__BackingField"; /// - /// Found at https://answers.unity.com/questions/960413/editor-window-how-to-center-a-window.html + /// Get the Unity editor main window position. /// - public static Rect GetEditorMainWindowPos() + public static Rect GetEditorMainWindowPosition() { + // Found at https://answers.unity.com/questions/960413/editor-window-how-to-center-a-window.html var containerWinType = AppDomain.CurrentDomain.GetAllDerivedTypes(typeof(ScriptableObject)).FirstOrDefault(t => t.Name == "ContainerWindow"); if (containerWinType == null) @@ -711,7 +911,7 @@ private static Type[] GetAllDerivedTypes(this AppDomain appDomain, Type aType) /// public static void CenterOnMainWin(this EditorWindow window) { - var main = GetEditorMainWindowPos(); + var main = GetEditorMainWindowPosition(); var pos = window.position; float w = (main.width - pos.width) * 0.5f; float h = (main.height - pos.height) * 0.5f; @@ -894,14 +1094,25 @@ public static Vector3 SphereMoveHandle(Object target, Vector3 position, float xS /// Draw a vector handle. /// /// Object that is undergoing the transformation. Also used for recording undo. + /// The origin of the vector. + /// The vector being drawn. /// Optional, Normalize the new vector value. - /// Optional, Clamp new vector's value based on the distance to the origin. + /// Optional, Clamp new vector's value based on the distance to the . /// Optional, handle length. /// Optional, handle size. /// Optional, auto sizes the handles based on position and handle size. /// Optional, records undo state. /// The new Vector3 value. - public static Vector3 VectorHandle(Object target, Vector3 origin, Vector3 vector, bool normalize = true, bool clamp = true, float handleLength = 1f, float handleSize = 0.1f, bool recordUndo = true, bool autoSize = true) + public static Vector3 VectorHandle( + Object target, + Vector3 origin, + Vector3 vector, + bool normalize = true, + bool clamp = true, + float handleLength = 1f, + float handleSize = 0.1f, + bool recordUndo = true, + bool autoSize = true) { Handles.color = HandleColorTangent; diff --git a/com.microsoft.mrtk.core/Editor/Utilities/MRTKEditorStyles.cs b/com.microsoft.mrtk.core/Editor/Utilities/MRTKEditorStyles.cs index 434f91a0560..71780076027 100644 --- a/com.microsoft.mrtk.core/Editor/Utilities/MRTKEditorStyles.cs +++ b/com.microsoft.mrtk.core/Editor/Utilities/MRTKEditorStyles.cs @@ -6,10 +6,13 @@ namespace Microsoft.MixedReality.Toolkit.Editor { + /// + /// A static class holding default MRTK editor styles. + /// public static class MRTKEditorStyles { /// - /// Default style for foldouts with bold title + /// A default style for foldouts with bold title. /// public static readonly GUIStyle BoldFoldoutStyle = new GUIStyle(EditorStyles.foldout) { @@ -17,7 +20,7 @@ public static class MRTKEditorStyles }; /// - /// Default style for foldouts with bold large font size title + /// A default style for foldouts with bold large font size title. /// public static readonly GUIStyle BoldTitleFoldoutStyle = new GUIStyle(EditorStyles.foldout) { @@ -26,7 +29,7 @@ public static class MRTKEditorStyles }; /// - /// Default style for foldouts with large font size title + /// A default style for foldouts with large font size title. /// public static readonly GUIStyle TitleFoldoutStyle = new GUIStyle(EditorStyles.foldout) { @@ -34,7 +37,7 @@ public static class MRTKEditorStyles }; /// - /// Default style for controller mapping buttons + /// A default style for controller mapping buttons. /// public static readonly GUIStyle ControllerButtonStyle = new GUIStyle("iconButton") { @@ -51,7 +54,7 @@ public static class MRTKEditorStyles }; /// - /// Default style for bold large font size title + /// A default style for bold large font size title. /// public static readonly GUIStyle BoldLargeTitleStyle = new GUIStyle(EditorStyles.boldLabel) { @@ -64,7 +67,7 @@ public static class MRTKEditorStyles }; /// - /// Reusable GUIStyle for drawing the MRTK product name label. + /// A reusable for drawing the MRTK product name label. /// public static readonly GUIStyle ProductNameStyle = new GUIStyle(EditorStyles.boldLabel) { @@ -74,7 +77,7 @@ public static class MRTKEditorStyles }; /// - /// Box style with left margin + /// Get a box style with left margin. /// public static GUIStyle BoxStyle(int margin) { @@ -84,10 +87,10 @@ public static GUIStyle BoxStyle(int margin) } /// - /// Help box style with left margin + /// Get a help box style with left margin. /// /// amount of left margin - /// Configured helpbox GUIStyle + /// A configured for the help box. public static GUIStyle HelpBoxStyle(int margin) { GUIStyle box = new GUIStyle(EditorStyles.helpBox); @@ -96,7 +99,7 @@ public static GUIStyle HelpBoxStyle(int margin) } /// - /// Create a custom label style based on color and size + /// Create a custom label style based on color and size. /// public static GUIStyle LabelStyle(int size, Color color) { diff --git a/com.microsoft.mrtk.core/Editor/Utilities/PropertyDrawerUtilities.cs b/com.microsoft.mrtk.core/Editor/Utilities/PropertyDrawerUtilities.cs index 5e37da84e5d..2b2587c5179 100644 --- a/com.microsoft.mrtk.core/Editor/Utilities/PropertyDrawerUtilities.cs +++ b/com.microsoft.mrtk.core/Editor/Utilities/PropertyDrawerUtilities.cs @@ -11,8 +11,19 @@ namespace Microsoft.MixedReality.Toolkit.Editor /// public static class PropertyDrawerUtilities { + /// + /// The default vertical padding for the drawn properties. + /// public const int VerticalPadding = 2; + + /// + /// The default height for the drawn properties. + /// public const int Height = 16; + + /// + /// The default vertical spacing for the drawn properties. + /// public const int VerticalSpacing = Height + VerticalPadding; /// @@ -35,7 +46,7 @@ public static float CalculatePropertyHeight(int lines) /// The "row number" for the control. /// The height of the row. /// - /// Rect providing the position at which to place the control. + /// A providing the position at which to place the control. /// public static Rect GetPosition( Rect rootPosition, diff --git a/com.microsoft.mrtk.core/Editor/Utilities/ReserializeAssetsUtility.cs b/com.microsoft.mrtk.core/Editor/Utilities/ReserializeAssetsUtility.cs index 840b3c41e93..985f5cd23fa 100644 --- a/com.microsoft.mrtk.core/Editor/Utilities/ReserializeAssetsUtility.cs +++ b/com.microsoft.mrtk.core/Editor/Utilities/ReserializeAssetsUtility.cs @@ -8,14 +8,19 @@ namespace Microsoft.MixedReality.Toolkit.Editor { /// - /// Adds menu items to automate reserializing specific files in Unity. + /// Adds menu items to automate re-serialize specific files in Unity. /// /// - /// Reserialization can be needed between Unity versions or when the - /// underlying script or asset definitions are changed. + /// + /// The process of re-serializing can be needed between Unity versions or when the + /// underlying script or asset definitions are changed. + /// /// public class ReserializeUtility { + /// + /// Re-serialize all Unity prefab and scene assets. + /// [MenuItem("Mixed Reality/MRTK3/Utilities/Reserialize/Prefabs, Scenes, and ScriptableObjects")] private static void ReserializePrefabsAndScenes() { @@ -24,6 +29,9 @@ private static void ReserializePrefabsAndScenes() Debug.Log($"Reserialized {array.Length} assets."); } + /// + /// Re-serialize all Unity material assets. + /// [MenuItem("Mixed Reality/MRTK3/Utilities/Reserialize/Materials and Textures")] private static void ReserializeMaterials() { @@ -32,6 +40,9 @@ private static void ReserializeMaterials() Debug.Log($"Reserialized {array.Length} assets."); } + /// + /// Re-serialize the currently selected set of Unity assets. + /// [MenuItem("Mixed Reality/MRTK3/Utilities/Reserialize/Reserialize Selection")] [MenuItem("Assets/Mixed Reality/MRTK3/Reserialize Selection")] public static void ReserializeSelection() diff --git a/com.microsoft.mrtk.core/Tests/Editor/MRTK3ProfileEditorTest.cs b/com.microsoft.mrtk.core/Tests/Editor/MRTK3ProfileEditorTest.cs index 25ce2bf317c..97fa5d212ec 100644 --- a/com.microsoft.mrtk.core/Tests/Editor/MRTK3ProfileEditorTest.cs +++ b/com.microsoft.mrtk.core/Tests/Editor/MRTK3ProfileEditorTest.cs @@ -16,8 +16,8 @@ namespace Microsoft.MixedReality.Toolkit.Core.Tests.EditMode internal class MRTK3ProfileEditorTest { /// - /// Verify that the window can be opened. - /// + /// Verify that the window can be opened. + /// v /// /// This test is disabled when executing in batch mode, since it requires a Unity graphic device. /// diff --git a/com.microsoft.mrtk.core/Tests/TestUtilities/RuntimeTestUtilities.cs b/com.microsoft.mrtk.core/Tests/TestUtilities/RuntimeTestUtilities.cs index 80be84a2412..df45fb13542 100644 --- a/com.microsoft.mrtk.core/Tests/TestUtilities/RuntimeTestUtilities.cs +++ b/com.microsoft.mrtk.core/Tests/TestUtilities/RuntimeTestUtilities.cs @@ -111,7 +111,10 @@ public static void ShowWindow() window.Show(); } - void OnGUI() + /// + /// A function called by Unity to render and handle GUI events. + /// + private void OnGUI() { GUILayout.Label("Test Paused for Debugging", EditorStyles.boldLabel); if (GUILayout.Button("Resume Test")) diff --git a/com.microsoft.mrtk.data/Editor/Inspectors/DataConsumerSpriteInspector.cs b/com.microsoft.mrtk.data/Editor/Inspectors/DataConsumerSpriteInspector.cs index d063f6994ab..95472e6a91e 100644 --- a/com.microsoft.mrtk.data/Editor/Inspectors/DataConsumerSpriteInspector.cs +++ b/com.microsoft.mrtk.data/Editor/Inspectors/DataConsumerSpriteInspector.cs @@ -22,7 +22,9 @@ private void OnEnable() valueToSpriteLookup = serializedObject.FindProperty("valueToSpriteLookup"); } - /// + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { serializedObject.Update(); diff --git a/com.microsoft.mrtk.data/Editor/Inspectors/DataKeyPathMapperInspector.cs b/com.microsoft.mrtk.data/Editor/Inspectors/DataKeyPathMapperInspector.cs index 60cdb161720..e7953a27cd8 100644 --- a/com.microsoft.mrtk.data/Editor/Inspectors/DataKeyPathMapperInspector.cs +++ b/com.microsoft.mrtk.data/Editor/Inspectors/DataKeyPathMapperInspector.cs @@ -22,7 +22,9 @@ private void OnEnable() viewKeypathToDataKeypathMapper = serializedObject.FindProperty("viewKeypathToDataKeypathMapper"); } - /// + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { serializedObject.Update(); diff --git a/com.microsoft.mrtk.input/Editor/Inspectors/CameraSimulationSettingsDrawer.cs b/com.microsoft.mrtk.input/Editor/Inspectors/CameraSimulationSettingsDrawer.cs index f1a67a2e855..a06edccb6a7 100644 --- a/com.microsoft.mrtk.input/Editor/Inspectors/CameraSimulationSettingsDrawer.cs +++ b/com.microsoft.mrtk.input/Editor/Inspectors/CameraSimulationSettingsDrawer.cs @@ -8,7 +8,7 @@ namespace Microsoft.MixedReality.Toolkit.Input.Simulation.Editor { /// - /// Custom drawer for the CameraSettings object. + /// A custom property drawer for fields. /// [CustomPropertyDrawer(typeof(CameraSimulationSettings))] public class CameraSimulationSettingsDrawer : PropertyDrawer @@ -35,6 +35,7 @@ public override float GetPropertyHeight( return PropertyDrawerUtilities.CalculatePropertyHeight(15); } + /// public override void OnGUI( Rect position, SerializedProperty property, diff --git a/com.microsoft.mrtk.input/Editor/Inspectors/ControllerSimulationSettingsDrawer.cs b/com.microsoft.mrtk.input/Editor/Inspectors/ControllerSimulationSettingsDrawer.cs index f616654ca52..f00fcfaa4b7 100644 --- a/com.microsoft.mrtk.input/Editor/Inspectors/ControllerSimulationSettingsDrawer.cs +++ b/com.microsoft.mrtk.input/Editor/Inspectors/ControllerSimulationSettingsDrawer.cs @@ -8,7 +8,7 @@ namespace Microsoft.MixedReality.Toolkit.Input.Simulation.Editor { /// - /// Custom inspector drawing for the ControllerSimulationSettings object. + /// A custom property drawer for fields. /// [CustomPropertyDrawer(typeof(ControllerSimulationSettings))] public class ControllerSimulationSettingsDrawer : PropertyDrawer @@ -45,6 +45,7 @@ public class ControllerSimulationSettingsDrawer : PropertyDrawer private readonly GUIContent triggerContent = new GUIContent("Trigger"); private readonly GUIContent gripContent = new GUIContent("Grip"); + /// public override float GetPropertyHeight( SerializedProperty property, GUIContent label) @@ -52,6 +53,7 @@ public override float GetPropertyHeight( return PropertyDrawerUtilities.CalculatePropertyHeight(29); } + /// public override void OnGUI( Rect position, SerializedProperty property, diff --git a/com.microsoft.mrtk.input/Editor/Inspectors/EyeGazeSimulationSettingsDrawer.cs b/com.microsoft.mrtk.input/Editor/Inspectors/EyeGazeSimulationSettingsDrawer.cs index 5cc6c2b6fd8..d0cb1f19c1f 100644 --- a/com.microsoft.mrtk.input/Editor/Inspectors/EyeGazeSimulationSettingsDrawer.cs +++ b/com.microsoft.mrtk.input/Editor/Inspectors/EyeGazeSimulationSettingsDrawer.cs @@ -8,7 +8,7 @@ namespace Microsoft.MixedReality.Toolkit.Input.Simulation.Editor { /// - /// Custom drawer for the EyeGazeSimulationSettings object. + /// A custom property drawer for fields. /// [CustomPropertyDrawer(typeof(EyeGazeSimulationSettings))] public class EyeGazeSimulationSettingsDrawer : PropertyDrawer @@ -24,6 +24,7 @@ public class EyeGazeSimulationSettingsDrawer : PropertyDrawer private readonly GUIContent lookHorizontalContent = new GUIContent("Horizontal"); private readonly GUIContent lookVerticalContent = new GUIContent("Vertical"); + /// public override float GetPropertyHeight( SerializedProperty property, GUIContent label) @@ -31,6 +32,7 @@ public override float GetPropertyHeight( return PropertyDrawerUtilities.CalculatePropertyHeight(6); } + /// public override void OnGUI( Rect position, SerializedProperty property, diff --git a/com.microsoft.mrtk.input/Editor/Inspectors/InteractionDetectorEditor.cs b/com.microsoft.mrtk.input/Editor/Inspectors/InteractionDetectorEditor.cs index 7818d4fce08..cd7fc376f6a 100644 --- a/com.microsoft.mrtk.input/Editor/Inspectors/InteractionDetectorEditor.cs +++ b/com.microsoft.mrtk.input/Editor/Inspectors/InteractionDetectorEditor.cs @@ -5,10 +5,10 @@ namespace Microsoft.MixedReality.Toolkit.Input.Editor { - [CustomEditor(typeof(InteractionDetector))] /// - /// Custom editor for the basic interaction mode detector implementation. + /// A custom editor for the class. /// + [CustomEditor(typeof(InteractionDetector))] public class InteractionDetectorEditor : UnityEditor.Editor { private SerializedProperty interactor; @@ -23,6 +23,9 @@ public class InteractionDetectorEditor : UnityEditor.Editor private SerializedProperty modeOnSelect; + /// + /// A Unity event function that is called when the script component has been enabled. + /// public void OnEnable() { interactor = serializedObject.FindProperty("interactor"); @@ -33,6 +36,9 @@ public void OnEnable() modeOnSelect = serializedObject.FindProperty("modeOnSelect"); } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { EditorGUILayout.PropertyField(interactor); diff --git a/com.microsoft.mrtk.input/Editor/Inspectors/InteractionModePropertyDrawer.cs b/com.microsoft.mrtk.input/Editor/Inspectors/InteractionModePropertyDrawer.cs index fcab22790d5..8132495dc5a 100644 --- a/com.microsoft.mrtk.input/Editor/Inspectors/InteractionModePropertyDrawer.cs +++ b/com.microsoft.mrtk.input/Editor/Inspectors/InteractionModePropertyDrawer.cs @@ -6,10 +6,9 @@ using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Input.Editor -{ +{ /// - /// A custom drawer used when rendering information about a InteractionMode - /// property within a Unity inspector window. + /// A custom property drawer for fields. /// [CustomPropertyDrawer(typeof(InteractionMode))] public class InteractionModePropertyDrawer : PropertyDrawer @@ -23,6 +22,7 @@ public class InteractionModePropertyDrawer : PropertyDrawer private static float MessageRectOffset => EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + /// public override void OnGUI(Rect rect, SerializedProperty property, GUIContent content) { InteractionModeManager instance = InteractionModeManager.Instance; @@ -79,6 +79,7 @@ public override void OnGUI(Rect rect, SerializedProperty property, GUIContent co } } + /// public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { return InteractionModeManager.Instance != null ? diff --git a/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs b/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs index b30b6c3a3f2..cb1493c405e 100644 --- a/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs +++ b/com.microsoft.mrtk.input/Tests/Runtime/Utilities/InputTestUtilities.cs @@ -259,6 +259,7 @@ public static IEnumerator SetHandTrackingState(Handedness handedness, bool isTra /// /// Update the test hand's position, rotation, and shape. /// + /// /// /// This moves the hand from to , rotates the hand from /// to , and smooths the handshape @@ -316,7 +317,7 @@ public static IEnumerator UpdateHand( yield return null; } } -/ + /// /// Move the test hand. /// @@ -325,7 +326,6 @@ public static IEnumerator UpdateHand( /// This moves the hand from to , and smooths the handshape /// based on the provided over the number of steps provided by . /// - /// /// /// The parameter defaults to a value of -1, which is a sentinel value to indicate that the /// default number of steps should be used as specified by . @@ -674,4 +674,4 @@ public static IEnumerator EnableEyeGazeDevice() } } } -#pragma warning restore CS1591 \ No newline at end of file +#pragma warning restore CS1591 diff --git a/com.microsoft.mrtk.spatialmanipulation/Editor/Constraints/ConstraintManagerEditor.cs b/com.microsoft.mrtk.spatialmanipulation/Editor/Constraints/ConstraintManagerEditor.cs index 57d47045b50..aa8ff5025b4 100644 --- a/com.microsoft.mrtk.spatialmanipulation/Editor/Constraints/ConstraintManagerEditor.cs +++ b/com.microsoft.mrtk.spatialmanipulation/Editor/Constraints/ConstraintManagerEditor.cs @@ -216,6 +216,9 @@ private void RenderManualConstraintMenu() } } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { if (target != null) diff --git a/com.microsoft.mrtk.spatialmanipulation/Editor/ObjectManipulator/ObjectManipulatorEditor.cs b/com.microsoft.mrtk.spatialmanipulation/Editor/ObjectManipulator/ObjectManipulatorEditor.cs index c0ca65ece88..5f8991237f1 100644 --- a/com.microsoft.mrtk.spatialmanipulation/Editor/ObjectManipulator/ObjectManipulatorEditor.cs +++ b/com.microsoft.mrtk.spatialmanipulation/Editor/ObjectManipulator/ObjectManipulatorEditor.cs @@ -98,6 +98,7 @@ protected override void OnEnable() static bool baseInteractableFoldout = false; + /// protected override void DrawProperties() { EditorGUILayout.Space(); diff --git a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/FollowEditor.cs b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/FollowEditor.cs index ef7f1124668..8651fd8a2e7 100644 --- a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/FollowEditor.cs +++ b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/FollowEditor.cs @@ -6,6 +6,9 @@ namespace Microsoft.MixedReality.Toolkit.SpatialManipulation.Editor { + /// + /// A custom editor for the class. + /// [CustomEditor(typeof(Follow))] [CanEditMultipleObjects] public class FollowEditor : SolverEditor @@ -75,6 +78,9 @@ protected override void OnEnable() solverInBetween = target as Follow; } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { base.OnInspectorGUI(); diff --git a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/InBetweenEditor.cs b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/InBetweenEditor.cs index c2f50bcf40e..d93b88c1666 100644 --- a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/InBetweenEditor.cs +++ b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/InBetweenEditor.cs @@ -5,6 +5,9 @@ namespace Microsoft.MixedReality.Toolkit.SpatialManipulation.Editor { + /// + /// A custom editor for the class. + /// [CustomEditor(typeof(InBetween))] [CanEditMultipleObjects] public class InBetweenEditor : SolverEditor @@ -29,6 +32,9 @@ protected override void OnEnable() partwayOffsetProperty = serializedObject.FindProperty("partwayOffset"); } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { base.OnInspectorGUI(); diff --git a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SolverEditor.cs b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SolverEditor.cs index 83b38dda7ae..f6d15556d01 100644 --- a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SolverEditor.cs +++ b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SolverEditor.cs @@ -5,6 +5,9 @@ namespace Microsoft.MixedReality.Toolkit.SpatialManipulation.Editor { + /// + /// A custom editor for the class. + /// [CustomEditor(typeof(Solver))] [CanEditMultipleObjects] public class SolverEditor : UnityEditor.Editor @@ -31,6 +34,9 @@ protected virtual void OnEnable() lifetimeProperty = serializedObject.FindProperty("lifetime"); } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { serializedObject.Update(); diff --git a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SolverHandlerEditor.cs b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SolverHandlerEditor.cs index 0559e6a384f..f11e502e5f4 100644 --- a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SolverHandlerEditor.cs +++ b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SolverHandlerEditor.cs @@ -6,6 +6,9 @@ namespace Microsoft.MixedReality.Toolkit.SpatialManipulation.Editor { + /// + /// A custom editor for the class. + /// [CustomEditor(typeof(SolverHandler))] [CanEditMultipleObjects] public class SolverHandlerEditor : UnityEditor.Editor @@ -40,6 +43,9 @@ protected void OnEnable() solverHandler = target as SolverHandler; } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { serializedObject.Update(); diff --git a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SurfaceMagnetismEditor.cs b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SurfaceMagnetismEditor.cs index e3ce8b8e5f6..246790d48e0 100644 --- a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SurfaceMagnetismEditor.cs +++ b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/SurfaceMagnetismEditor.cs @@ -8,6 +8,9 @@ namespace Microsoft.MixedReality.Toolkit.SpatialManipulation.Editor { + /// + /// A custom editor for the class. + /// [CustomEditor(typeof(SurfaceMagnetism))] [CanEditMultipleObjects] public class SurfaceMagnetismEditor : SolverEditor @@ -62,6 +65,9 @@ protected override void OnEnable() surfaceMagnetism = target as SurfaceMagnetism; } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { base.OnInspectorGUI(); diff --git a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/TapToPlaceEditor.cs b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/TapToPlaceEditor.cs index 5981179ca2d..e1d2df99783 100644 --- a/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/TapToPlaceEditor.cs +++ b/com.microsoft.mrtk.spatialmanipulation/Editor/Solvers/TapToPlaceEditor.cs @@ -72,12 +72,17 @@ protected virtual void OnEnable() magneticSurfaces = serializedObject.FindProperty("magneticSurfaces"); } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { RenderCustomInspector(); } - - // Render the custom inspector with the basic and advanced properties + + /// + /// Render the custom inspector with the basic and advanced properties + /// private void RenderCustomInspector() { serializedObject.Update(); diff --git a/com.microsoft.mrtk.tools/SubsystemWizard/SubsystemGenerator.cs b/com.microsoft.mrtk.tools/SubsystemWizard/SubsystemGenerator.cs index fc295ea9b5c..7a5fab26da8 100644 --- a/com.microsoft.mrtk.tools/SubsystemWizard/SubsystemGenerator.cs +++ b/com.microsoft.mrtk.tools/SubsystemWizard/SubsystemGenerator.cs @@ -325,6 +325,9 @@ public bool ValidateSubsystemName(out string error) /// /// object representing the subsystem class template file. /// + /// + /// object representing the derived class template file. + /// /// /// object representing the subsystem configuration template file. /// diff --git a/com.microsoft.mrtk.tools/SubsystemWizard/SubsystemWizardWindow.cs b/com.microsoft.mrtk.tools/SubsystemWizard/SubsystemWizardWindow.cs index 315317cb8e4..16febbeb766 100644 --- a/com.microsoft.mrtk.tools/SubsystemWizard/SubsystemWizardWindow.cs +++ b/com.microsoft.mrtk.tools/SubsystemWizard/SubsystemWizardWindow.cs @@ -46,6 +46,9 @@ private static void Init() } } + /// + /// A function called by Unity to render and handle GUI events. + /// private void OnGUI() { if (window == null) diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ButtonTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ButtonTheme.cs index f216ef9a174..187f4919d85 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ButtonTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ButtonTheme.cs @@ -7,10 +7,14 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// All theme elements of a MRTK UX Button. + /// All theme elements of a MRTK UX ActionButton. /// /// /// + /// A MRTK ActionButton object can be added to the an object via the MRTK + /// game object menu item in Unity. + /// + /// /// Note, that by default whenever a theme element /// is shared by different control types, the same /// element is repeated in UX.Common and the default diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/CommonTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/CommonTheme.cs index edb5dae1bb8..c1ba00fe11d 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/CommonTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/CommonTheme.cs @@ -8,7 +8,7 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// Button control theme elements. + /// Common MRTK control theme elements. /// /// /// This is an experimental feature. This class is early in the cycle, it has diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/DialogTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/DialogTheme.cs index b62fea42d98..b825139dc15 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/DialogTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/DialogTheme.cs @@ -11,6 +11,10 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental /// /// /// + /// A MRTK Dialog component can be added to the an object via the MRTK + /// menu items within Unity's add component menu. + /// + /// /// Note that by default the only maps /// to UX.Common.xxx instead of UX.Dialog.xxx for any /// element that is common across all UX elements. @@ -35,6 +39,5 @@ public class DialogTheme /// Backplate material for a dialog slate. /// public Material BackplateMaterial => backplateMaterial; - } } diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/HandMenuTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/HandMenuTheme.cs index 8001c434fae..6b45b9cf477 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/HandMenuTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/HandMenuTheme.cs @@ -7,10 +7,14 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// All theme elements of a MRTK UX Dialog slate. + /// All theme elements of a MRTK UX HandMenu. /// /// /// + /// A MRTK HandMenu component can be added to the an object via the MRTK + /// menu items within Unity's add component menu. + /// + /// /// Note that by default the only maps /// to UX.Common.xxx instead of UX.HandMenu.xxx for any /// element that is common across all UX elements. diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ListMenuTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ListMenuTheme.cs index bb2b2eeb101..1e8eea40512 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ListMenuTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ListMenuTheme.cs @@ -7,10 +7,14 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// All theme elements of a MRTK UX Dialog slate. + /// All theme elements of a MRTK UX ListMenu. /// /// /// + /// A MRTK ListMenu object can be added to the an object via the MRTK + /// game object menu item in Unity. + /// + /// /// Note that by default the only maps /// to UX.Common.xxx instead of UX.List.xxx for any /// element that is common across all UX elements. diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ObjectBarTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ObjectBarTheme.cs index de7208e88c3..dbf292d9ef9 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ObjectBarTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ObjectBarTheme.cs @@ -7,19 +7,26 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// All themable elements of a MRTK UX Dialog slate. - /// + /// All theme elements of the MRTK ObjectBar. + /// + /// + /// + /// A MRTK ObjectBar component can be added to the an object via the MRTK + /// menu items within Unity's add component menu. + /// + /// /// Note that by default the only maps /// to UX.Common.xxx instead of UX.ObjectBar.xxx for any /// element that is common across all UX elements. - /// - /// + /// + /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, 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 enough so to provide feedback. + /// /// [Serializable] public class ObjectBarTheme @@ -28,6 +35,10 @@ public class ObjectBarTheme [Tooltip("Backplate material for a object bar.")] [SerializeField] private Material backplateMaterial; + + /// + /// Backplate material for a object bar. + /// public Material BackplateMaterial => backplateMaterial; } diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SlateTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SlateTheme.cs index 8ccb0b95f40..bb4490c7d38 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SlateTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SlateTheme.cs @@ -7,19 +7,22 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// All themable elements of a MRTK UX Dialog slate. - /// - /// Note that by default the only maps - /// to UX.Common.xxx instead of UX.Slate.xxx for any - /// element that is common across all UX elements. + /// All theme elements of a MRTK UX Slate. /// /// + /// + /// Note that by default the only maps + /// to UX.Common.xxx instead of UX.Slate.xxx for any + /// element that is common across all UX elements. + /// + /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, 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 enough so to provide feedback. + /// /// [Serializable] public class SlateTheme @@ -27,16 +30,28 @@ public class SlateTheme [Tooltip("Backplate material for the title section of slate.")] [SerializeField] private Material titleBackplateMaterial; + + /// + /// Backplate material for the title section of slate. + /// public Material TitleBackplateMaterial => titleBackplateMaterial; [Tooltip("Backplate material for the content section of a slate.")] [SerializeField] private Material contentBackplateMaterial; + + /// + /// Backplate material for the content section of a slate. + /// public Material ContentBackplateMaterial => contentBackplateMaterial; [Tooltip("Backplate material for simple slates.")] [SerializeField] private Material innerQuadBackplateMaterial; + + /// + /// Backplate material for simple slates. + /// public Material InnerQuadBackplateMaterial => innerQuadBackplateMaterial; } } diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SliderTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SliderTheme.cs index 5031a8e1da4..fa041c76c5e 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SliderTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SliderTheme.cs @@ -7,19 +7,26 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// All themable elements of a MRTK UX Slider. - /// - /// Note that by default the only maps - /// to UX.Common.xxx instead of UX.Button.xxx for any - /// element that is common across all UX elements. + /// All theme elements of a MRTK UX Slider. /// /// + /// + /// A MRTK Slider component can be added to the an object via the MRTK + /// menu items within Unity's add component menu. + /// + /// + /// Note that by default the only maps + /// to UX.Common.xxx instead of UX.Button.xxx for any + /// element that is common across all UX elements. + /// + /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, 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 enough so to provide feedback. + /// /// [Serializable] public class SliderTheme @@ -27,21 +34,37 @@ public class SliderTheme [Tooltip("Material for the entire base of a slider.")] [SerializeField] private Material trackBaseVisualMaterial; + + /// + /// Material for the entire base of a slider. + /// public Material TrackBaseVisualMaterial => trackBaseVisualMaterial; [Tooltip("Material for highlighting the filled portion of the slider.")] [SerializeField] private Material trackFilledVisualMaterial; + + /// + /// Material for highlighting the filled portion of the slider. + /// public Material TrackFilledVisualMaterial => trackFilledVisualMaterial; [Tooltip("Material for the visualization of a slider thumb.")] [SerializeField] private Material thumbVisualMaterial; + + /// + /// Material for the visualization of a slider thumb. + /// public Material ThumbVisualMaterial => thumbVisualMaterial; [Tooltip("Backplate material for the entire slider.")] [SerializeField] private Material backplateMaterial; + + /// + /// Backplate material for the entire slider. + /// public Material BackplateMaterial => backplateMaterial; } diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SpriteSetTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SpriteSetTheme.cs index d2225c061a4..31b0a130f13 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SpriteSetTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/SpriteSetTheme.cs @@ -7,75 +7,125 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// /// A set of sprites that can be selected via the name of the property - /// in a data consumer theme. It allows the styling of the icons to be - /// changed to match a particular design goal. - /// - /// This class is intended to be included in other theme ScriptableObject - /// profiles that may want to allow for changing icon styles. + /// in a data consumer theme. /// /// + /// + /// This class enables the styling of the icons to be + /// changed to match a particular design goal. + /// + /// + /// This class is intended to be included in other theme + /// profiles that may want to allow for changing icon styles. + /// + /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, appear - /// to have a lot of value even if the details haven’t fully been fleshed out. + /// 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 enough so to provide feedback. + /// /// public class SpriteSetTheme { - [Tooltip("An 'Add' icon.")] + [Tooltip("An 'add' icon.")] [SerializeField] private Sprite add; + + /// + /// An 'Add' icon. + /// public Sprite Add => add; - [Tooltip("A 'Check' icon.")] + [Tooltip("A 'check' icon.")] [SerializeField] private Sprite check; + + /// + /// A 'check' icon. + /// public Sprite Check => check; - [Tooltip("A 'Circle' icon.")] + [Tooltip("A 'circle' icon.")] [SerializeField] private Sprite circle; + + /// + /// A 'circle' icon. + /// public Sprite Circle => circle; - [Tooltip("A 'Close' icon.")] + [Tooltip("A 'close' icon.")] [SerializeField] private Sprite close; + + /// + /// A 'close' icon. + /// public Sprite Close => close; - [Tooltip("A 'Contacts' icon.")] + [Tooltip("A 'contacts' icon.")] [SerializeField] private Sprite contacts; + + /// + /// A 'contacts' icon. + /// public Sprite Contacts => contacts; - [Tooltip("A 'Favorites' icon.")] + [Tooltip("A 'favorites' icon.")] [SerializeField] private Sprite favorite; + + /// + /// A 'favorites' icon. + /// public Sprite Favorite => favorite; - [Tooltip("A 'Music' icon.")] + [Tooltip("A 'music' icon.")] [SerializeField] private Sprite music; + + /// + /// A 'music' icon. + /// public Sprite Music => music; - [Tooltip("A 'Play' icon.")] + [Tooltip("A 'play' icon.")] [SerializeField] private Sprite play; + + /// + /// A 'play' icon. + /// public Sprite Play => play; - [Tooltip("A 'Search' icon.")] + [Tooltip("A 'search' icon.")] [SerializeField] private Sprite search; + + /// + /// A 'search' icon. + /// public Sprite Search => search; - [Tooltip("A 'Trash' icon.")] + [Tooltip("A 'trash' icon.")] [SerializeField] private Sprite trash; + + /// + /// A 'trash' icon. + /// public Sprite Trash => trash; - [Tooltip("A 'Volume' icon.")] + [Tooltip("A 'volume' icon.")] [SerializeField] private Sprite volume; + + /// + /// A 'volume' icon. + /// public Sprite Volume => volume; } } diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ToggleTheme.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ToggleTheme.cs index 216e8caac05..50bb5343726 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ToggleTheme.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/ControlThemes/ToggleTheme.cs @@ -7,36 +7,55 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { /// - /// All themable elements of a MRTK UX Dialog slate. - /// - /// Note that by default the only maps - /// to UX.Common.xxx instead of UX.Toggle.xxx for any - /// element that is common across all UX elements. + /// All theme elements of a MRTK UX Toggle. /// /// + /// + /// A MRTK Toggle component can be added to the an object via the MRTK + /// menu items within Unity's add component menu. + /// + /// + /// Note that by default the only maps + /// to UX.Common.xxx instead of UX.Toggle.xxx for any + /// element that is common across all UX elements. + /// + /// /// This is an experimental feature. This class is early in the cycle, it has /// been labeled as experimental to indicate that it is still evolving, and /// subject to change over time. Parts of the MRTK, such as this class, 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 enough so to provide feedback. + /// /// [Serializable] public class ToggleTheme { - [Tooltip("Backplate material for a toggleable control.")] + [Tooltip("Backplate material for a toggle control.")] [SerializeField] private Material backplateMaterial; + + /// + /// Backplate material for a toggle control. + /// public Material BackplateMaterial => backplateMaterial; - [Tooltip("Backplate material for a toggleable switch control.")] + [Tooltip("Backplate material for a toggle switch control.")] [SerializeField] private Material thumbMaterial; + + /// + /// Backplate material for a toggle switch control. + /// public Material ThumbMaterial => thumbMaterial; - [Tooltip("A sprite to function as the shadow for the toggleable switch control.")] + [Tooltip("A sprite to function as the shadow for the toggle switch control.")] [SerializeField] private Sprite thumbShadowSprite; + + /// + /// A sprite to function as the shadow for the toggle switch control. + /// public Sprite ThumbShadowSprite => thumbShadowSprite; } } diff --git a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/UXThemeProfile.cs b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/UXThemeProfile.cs index be27eec4fb4..7fec7813146 100644 --- a/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/UXThemeProfile.cs +++ b/com.microsoft.mrtk.uxcomponents.noncanvas/Experimental/Theming/ProfileTemplates/UXThemeProfile.cs @@ -6,11 +6,14 @@ namespace Microsoft.MixedReality.Toolkit.UX.Experimental { + /// + /// A theme profile for UX components. + /// [CreateAssetMenu(fileName = "MRTK_UX_ThemeProfile", menuName = "MRTK/UX/Theme Profile")] public class UXThemeProfile : ScriptableObject { /// - /// A theme profile for UX components. + /// A theme for UX components. /// /// /// diff --git a/com.microsoft.mrtk.uxcore/Editor/Inspectors/FontIconSet/FontIconSelectorInspector.cs b/com.microsoft.mrtk.uxcore/Editor/Inspectors/FontIconSet/FontIconSelectorInspector.cs index 1e985596f93..b3a090f1d03 100644 --- a/com.microsoft.mrtk.uxcore/Editor/Inspectors/FontIconSet/FontIconSelectorInspector.cs +++ b/com.microsoft.mrtk.uxcore/Editor/Inspectors/FontIconSet/FontIconSelectorInspector.cs @@ -40,6 +40,9 @@ private void OnEnable() } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { if (!initializedStyle) diff --git a/com.microsoft.mrtk.uxcore/Editor/Inspectors/FontIconSet/FontIconSetInspector.cs b/com.microsoft.mrtk.uxcore/Editor/Inspectors/FontIconSet/FontIconSetInspector.cs index 52a493692ee..744fab4a47a 100644 --- a/com.microsoft.mrtk.uxcore/Editor/Inspectors/FontIconSet/FontIconSetInspector.cs +++ b/com.microsoft.mrtk.uxcore/Editor/Inspectors/FontIconSet/FontIconSetInspector.cs @@ -12,6 +12,9 @@ namespace Microsoft.MixedReality.Toolkit.Editor { + /// + /// A custom Unity editor for the class. + /// [CustomEditor(typeof(FontIconSet))] public class FontIconSetInspector : UnityEditor.Editor { @@ -64,6 +67,9 @@ private void OnEnable() } } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { FontIconSet fontIconSet = (FontIconSet)target; @@ -182,6 +188,11 @@ public override void OnInspectorGUI() serializedObject.ApplyModifiedProperties(); } + /// + /// Draw a grid of buttons than can be clicked to select a glyph from a set up glyphs. + /// + /// The set of font glyphs to draw. + /// The number of buttons per column. public void DrawFontGlyphsGrid(FontIconSet fontIconSet, int maxButtonsPerColumn) { TMP_FontAsset fontAsset = fontIconSet.IconFontAsset; @@ -275,6 +286,9 @@ private bool CheckIfHololensIconFontExists() return false; } + /// + /// Draws a Text Mesh Pro glyph in the supplied . + /// public static void EditorDrawTMPGlyph(Rect position, uint unicode, TMP_FontAsset fontAsset, bool selected = false, Material fontRenderMaterial = null) { if (fontAsset.characterLookupTable.TryGetValue(unicode, out TMP_Character character)) @@ -284,7 +298,7 @@ public static void EditorDrawTMPGlyph(Rect position, uint unicode, TMP_FontAsset } /// - /// Draws a Text Mesh Pro glyph in the supplied rect. Used for inspectors. + /// Draws a Text Mesh Pro glyph in the supplied . /// public static void EditorDrawTMPGlyph(Rect glyphRect, TMP_FontAsset fontAsset, TMP_Character character, bool selected = false, Material fontRenderMaterial = null) { diff --git a/com.microsoft.mrtk.uxcore/Editor/Inspectors/PressableButton/PressableButtonInspector.cs b/com.microsoft.mrtk.uxcore/Editor/Inspectors/PressableButton/PressableButtonInspector.cs index 97cffc9756d..fd8ac514108 100644 --- a/com.microsoft.mrtk.uxcore/Editor/Inspectors/PressableButton/PressableButtonInspector.cs +++ b/com.microsoft.mrtk.uxcore/Editor/Inspectors/PressableButton/PressableButtonInspector.cs @@ -7,6 +7,9 @@ namespace Microsoft.MixedReality.Toolkit.Editor { + /// + /// A custom Unity editor for the class. + /// [CustomEditor(typeof(PressableButton), true)] public class PressableButtonEditor : StatefulInteractableEditor { @@ -207,6 +210,7 @@ private float DrawPlaneAndHandle(Vector3[] vertices, Vector2 halfExtents, float static bool advancedButtonFoldout = false; static bool editorFoldout = false; + /// protected override void DrawProperties() { base.DrawProperties(); @@ -243,7 +247,7 @@ protected override void DrawProperties() EditorGUILayout.PropertyField(extendSpeed); EditorGUILayout.PropertyField(returnSpeed); - // Rolloff rejection + // Roll-off rejection EditorGUILayout.PropertyField(enforceFrontPush); EditorGUILayout.PropertyField(rejectXYRollOff); if (rejectXYRollOff.boolValue) diff --git a/com.microsoft.mrtk.uxcore/Editor/Inspectors/Slider/SliderInspector.cs b/com.microsoft.mrtk.uxcore/Editor/Inspectors/Slider/SliderInspector.cs index 56900d80b01..5bc3a92c479 100644 --- a/com.microsoft.mrtk.uxcore/Editor/Inspectors/Slider/SliderInspector.cs +++ b/com.microsoft.mrtk.uxcore/Editor/Inspectors/Slider/SliderInspector.cs @@ -7,11 +7,15 @@ namespace Microsoft.MixedReality.Toolkit.Editor { + /// + /// A custom Unity editor for the class. + /// [CustomEditor(typeof(Slider), true)] public class SliderInspector : StatefulInteractableEditor { private static GUIStyle labelStyle; + /// protected override void DrawProperties() { base.DrawProperties(showToggleMode: false); diff --git a/com.microsoft.mrtk.uxcore/Editor/Inspectors/StateVisualizer/StateVisualizerInspector.cs b/com.microsoft.mrtk.uxcore/Editor/Inspectors/StateVisualizer/StateVisualizerInspector.cs index 7509a5fc6fd..f28647d8b17 100644 --- a/com.microsoft.mrtk.uxcore/Editor/Inspectors/StateVisualizer/StateVisualizerInspector.cs +++ b/com.microsoft.mrtk.uxcore/Editor/Inspectors/StateVisualizer/StateVisualizerInspector.cs @@ -49,6 +49,9 @@ protected virtual void OnEnable() } } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { valueLabelStyle = EditorStyles.miniLabel; diff --git a/com.microsoft.mrtk.windowsspeech/Editor/Inspectors/WindowsTextToSpeechSubsystemConfigInspector.cs b/com.microsoft.mrtk.windowsspeech/Editor/Inspectors/WindowsTextToSpeechSubsystemConfigInspector.cs index b920ab8c24a..b88ca80ec2c 100644 --- a/com.microsoft.mrtk.windowsspeech/Editor/Inspectors/WindowsTextToSpeechSubsystemConfigInspector.cs +++ b/com.microsoft.mrtk.windowsspeech/Editor/Inspectors/WindowsTextToSpeechSubsystemConfigInspector.cs @@ -6,6 +6,9 @@ namespace Microsoft.MixedReality.Toolkit.Speech.Windows { + /// + /// A custom editor for the class. + /// [CustomEditor(typeof(WindowsTextToSpeechSubsystemConfig))] public class WindowsTextToSpeechSubsystemConfigInspector : UnityEditor.Editor { @@ -19,6 +22,9 @@ private void OnEnable() voiceProperty = serializedObject.FindProperty("voice"); } + /// + /// Called by the Unity editor to render custom inspector UI for this component. + /// public override void OnInspectorGUI() { if (voiceProperty.intValue == (int)TextToSpeechVoice.Other) From 978b026ffffb82ffb50ea7163a0e3139c68f3b58 Mon Sep 17 00:00:00 2001 From: Adam Mollis Date: Wed, 19 Jul 2023 14:18:22 -0700 Subject: [PATCH 05/10] Fixing typo --- .../Editor/PropertyDrawers/SelectRepairedTypeWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.microsoft.mrtk.core/Editor/PropertyDrawers/SelectRepairedTypeWindow.cs b/com.microsoft.mrtk.core/Editor/PropertyDrawers/SelectRepairedTypeWindow.cs index bdb2bcf6f45..41c0251c196 100644 --- a/com.microsoft.mrtk.core/Editor/PropertyDrawers/SelectRepairedTypeWindow.cs +++ b/com.microsoft.mrtk.core/Editor/PropertyDrawers/SelectRepairedTypeWindow.cs @@ -21,7 +21,7 @@ public class SelectRepairedTypeWindow : EditorWindow /// public static bool WindowOpen { - get =>? window != null; + get => window != null; } /// From dab310289ff6a02e85b2c3272bc259289105885a Mon Sep 17 00:00:00 2001 From: Adam Mollis Date: Wed, 19 Jul 2023 14:23:19 -0700 Subject: [PATCH 06/10] Minor tweak --- .../MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs index f7f97223f2b..6f2cd9ce83e 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs @@ -12,9 +12,10 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Demos { /// /// Manager for the performance evaluation scene. - /// It instantiates game objects until the frame rate drops below a set - /// limit /// + /// + /// This will instantiate game objects until the frame rate drops below a set limit. + /// public class PerfSceneManager : MonoBehaviour { // Reference to the description panel. The description is disabled when the test is run. From 4c4c21df0f4e8d93dd924ae00b1c109d12567dd6 Mon Sep 17 00:00:00 2001 From: Adam Mollis Date: Wed, 19 Jul 2023 14:23:47 -0700 Subject: [PATCH 07/10] minor tweaks --- .../MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs index 6f2cd9ce83e..31dbc742573 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs @@ -22,19 +22,19 @@ public class PerfSceneManager : MonoBehaviour [SerializeField] private GameObject descriptionPanel; - // Reference to the gameobject to spawn. + // Reference to the game object to spawn. [SerializeField] private GameObject model; - // TextmeshPro text field for the number of objects instantiated. + // TextMeshPro text field for the number of objects instantiated. [SerializeField] private TextMeshProUGUI countText; - // TextmeshPro text field for displaying the current framerate + // TextMeshPro text field for displaying the current framerate [SerializeField] private TextMeshProUGUI framerateText; - // TextmeshPro text field for displaying the results of the test. + // TextMeshPro text field for displaying the results of the test. [SerializeField] private TextMeshProUGUI resultsText; From 1b649946152e4e632940ffa6b3655fd86fc94e52 Mon Sep 17 00:00:00 2001 From: Adam Mollis Date: Wed, 19 Jul 2023 15:57:00 -0700 Subject: [PATCH 08/10] Remove bogus URL --- .../Scripts/DataSourceJsonThemeTest.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonThemeTest.cs b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonThemeTest.cs index 593869078d1..a46d102c445 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonThemeTest.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scripts/DataSourceJsonThemeTest.cs @@ -17,16 +17,13 @@ namespace Microsoft.MixedReality.Toolkit.Data /// This will trigger notification changes by the base class once the data has been /// parsed. /// - /// - /// Note: The theme can be changed by pressing theme buttons at http://TryMRTK.com. - /// /// [AddComponentMenu("MRTK/Examples/Data Binding/Data Source Json Theme Test")] public class DataSourceJsonThemeTest : DataSourceGOJson { [Tooltip("URL for a json data source")] [SerializeField] - private string url = "http://TryMRTK.com/api/data"; + private string url = string.Empty; [Tooltip("How many seconds between fetching the data source and notifying all consumer of changes.")] [SerializeField] @@ -61,7 +58,7 @@ private void Update() { _time += Time.deltaTime; - if (_time >= secondsBetweenFetches) + if (_time >= secondsBetweenFetches && !string.IsNullOrEmpty(url)) { _time -= secondsBetweenFetches; From 9cff1ece6d7d47cfb80ef4f2f62795115edcea1b Mon Sep 17 00:00:00 2001 From: Adam Mollis Date: Wed, 19 Jul 2023 15:59:13 -0700 Subject: [PATCH 09/10] pr feedback --- .../MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs index 31dbc742573..bb506bc76f8 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/PerfSceneManager.cs @@ -22,7 +22,7 @@ public class PerfSceneManager : MonoBehaviour [SerializeField] private GameObject descriptionPanel; - // Reference to the game object to spawn. + // Reference to the GameObject to spawn. [SerializeField] private GameObject model; @@ -204,4 +204,4 @@ public void SetModelCount(int count) } } } -#pragma warning restore CS1591 \ No newline at end of file +#pragma warning restore CS1591 From 9cd26c447f35ae7e62f86dcc21f2029d88fde935 Mon Sep 17 00:00:00 2001 From: Adam Mollis Date: Wed, 19 Jul 2023 16:08:31 -0700 Subject: [PATCH 10/10] more pr changes --- .../Data Binding Example/Scenes/DataBindingExamples.unity | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scenes/DataBindingExamples.unity b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scenes/DataBindingExamples.unity index f21e7382315..63cd1e4cc01 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scenes/DataBindingExamples.unity +++ b/UnityProjects/MRTKDevTemplate/Assets/Data Binding Example/Scenes/DataBindingExamples.unity @@ -1144,7 +1144,7 @@ MonoBehaviour: m_EditorClassIdentifier: dataSourceType: themeFetcher keyPathMapper: {fileID: 0} - url: http://TryMRTK.com/api/data + url: secondsBetweenFetches: 1 themeSelector: {fileID: 297520969} --- !u!114 &297520967 @@ -2662,7 +2662,7 @@ MonoBehaviour: m_EditorClassIdentifier: dataSourceType: data keyPathMapper: {fileID: 0} - url: http://TryMRTK.com/nature-photos/photo_data.json + url: secondsBetweenFetches: 60 --- !u!4 &874612861 Transform: @@ -3930,7 +3930,7 @@ MonoBehaviour: m_EditorClassIdentifier: dataSourceType: data keyPathMapper: {fileID: 0} - url: http://TryMRTK.com/api/random_joke + url: secondsBetweenFetches: 15 --- !u!114 &1322284030 MonoBehaviour: @@ -7158,7 +7158,7 @@ MonoBehaviour: dataSourceType: data _staticCollectionSize: 20 _fluxCollectionSize: 20 - imageUrlTemplate: http://TryMRTK.com/nature-photos/images/{0:D4}.jpg + imageUrlTemplate: --- !u!4 &1987298545 Transform: m_ObjectHideFlags: 0