Namespace Unity.XRTools.Utils | XR Tools Utilities | 1.0.0
docs.unity3d.com
    Show / Hide Table of Contents

    Namespace Unity.XRTools.Utils

    Classes

    AssemblyDefinition

    BoundsExtensions

    Extension methods for the Bounds type

    BoundsUtils

    Bounds related utilities

    BoundsUtilsTests

    CachedComponentFilter<TFilterType, TRootType>

    Class that allows for cached retrieval/filtering of multiple types of components into lists Proper usage of this class is:

    using (var componentFilter = new CachedComponentFilter<typeToFind,componentTypeThatContains>(instanceOfComponent))
    {
    
    }

    CameraExtensions

    Extension methods for Camera components

    CoefficientUtils

    Utility methods for calculating portions of distances as 0-1 numbers

    CollectionExtensions

    Extension methods for ICollection objects

    CollectionPool<TCollection, TValue>

    A generic collection pool for avoiding allocations when new empty collections are needed frequently

    CompilationTest

    ComponentUtils

    Utility class for working with Components

    ComponentUtils<T>

    Special utility class for getting components in the editor without allocations

    ConditionalCompilationUtility

    The Conditional Compilation Utility (CCU) will add defines to the build settings once dependent classes have been detected. In order for this to be specified in any project without the project needing to include the CCU, at least one custom attribute must be created in the following form:

    [Conditional(UNITY_CCU)] // | This is necessary for CCU to pick up the right attributes public class OptionalDependencyAttribute : Attribute // | Must derive from System.Attribute { public string dependentClass; // | Required field specifying the fully qualified dependent class public string define; // | Required field specifying the define to add }

    Then, simply specify the assembly attribute(s) you created: [assembly: OptionalDependency("UnityEngine.InputNew.InputSystem", "USE_NEW_INPUT")] [assembly: OptionalDependency("Valve.VR.IVRSystem", "ENABLE_STEAMVR_INPUT")]

    namespace Foo { ... }

    DictionaryExtensions

    Extension methods for Dictionary objects

    EditorMaterialUtils

    Editor only Material utilities

    EditorMonoBehaviour

    Used for launching co-routines TODO: Use EditorCoroutines package

    EditorScriptableSettings<T>

    Based off of Unity's Internal ScriptableSingleton with UnityEditorInternal bits removed

    EditorUtils

    Utility methods for use in the Editor

    EnumValues<T>

    Helper class for caching enum values

    GameObjectExtensions

    Extensions methods for GameObjects

    GameObjectExtensionsTests

    GameObjectUtils

    Utility methods for creating GameObjects Allows systems to subscribe to gameObjectInstantiated

    GameObjectUtilsTests

    GeometryUtils

    Utility methods for common geometric operations

    GeometryUtilsTests

    GuidExtensions

    Extensions to System.Guid

    GuidUtil

    Utility for dealing with Guids.

    HashSetExtensions

    Extension methods for HashSet<T> objects

    LayerMaskExtensions

    Extension methods for LayerMask structs

    LayerMaskTests

    ListExtensions

    Extension methods for List<T> objects

    MaterialUtils

    Runtime Material utilities

    MaterialUtilsTests

    MathUtility

    Math utilities

    MathUtilityTests

    MonoBehaviourExtensions

    Extension methods for MonoBehaviour objects

    MonoBehaviourExtensionsTests

    NativeArrayUtils

    Utility methods for NativeArray<T>

    ObjectPool<T>

    Instance pool for objects

    OnDestroyNotifier

    Behavior that fires a callback when it is destroyed

    PoseExtensions

    Extension methods for Pose structs

    PoseExtensionsTests

    QuaternionExtensions

    Extension methods for Quaternion structs

    QuaternionExtensionsTests

    ReflectionUtils

    Utility methods for common reflection-based operations

    ScriptableSettings<T>

    Based off of Unity's Internal ScriptableSingleton with UnityEditorInternal bits removed

    ScriptableSettingsPathAttribute

    Allows a class inheriting from ScriptableSettings<T> to specify that its instance Asset should be saved under "Assets/[path]/Resources/ScriptableSettings/".

    ScriptableSettingsProvider<T>

    Expose a ScriptableSettings of type T as a settings provider

    ScriptableSettingsTests

    SerializableGuidUtil

    Utility for creating a Unity.XRTools.Utils.SerializableGuid. A SerializableGuid can be serialized by Unity, while a System.Guid cannot.

    StopwatchExtensions

    Extension methods for Stopwatch objects

    StringExtensions

    Extension methods for strings

    TagManagerTests

    TestImage

    TextureUtils

    Utilities for manipulating Textures

    TransformExtensions

    Extension methods for Transform components

    TransformExtensionsTests

    TypeExtensions

    Extension methods for Type objects

    TypeExtensionsTests

    UndoBlock

    Class that automatically groups a series of object actions together as a single undo-operation And works in both the editor and player (with player support simply turning off undo-operations) Mirrors the normal functions you find in the Undo class and collapses them into one operation when the block is complete Proper usage of this class is: using (var undoBlock = new UndoBlock("Desired Undo Message")) { undoBlock.yourCodeToUndo() }

    UnityObjectUtils

    Utility methods for working with UnityEngine.Object types

    UnityObjectUtilsTests

    Vec2ExtensionsTests

    Vector2Extensions

    Extension methods for the Vector2 type

    Vector3Extensions

    Extension methods for the Vector3 type

    Vector3ExtensionsTests

    Structs

    SerializableGuid

    A Guid that can be serialized by Unity. The 128-bit Guid is stored as two 64-bit ulongs. See also the creation utility at UnityEditor.XR.ARSubsystems.SerializableGuidUtil.

    Interfaces

    IComponentHost<THostType>

    Use this interface if you have a component that contains many instances of something you want discoverable by the cached component filter. Make sure the THostType matches up with the TFilterType in the CachedComponent filter

    Enums

    CachedSearchType

    Describes where the initial list of components should be built from

    MaterialUtils.BlendMode

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023