Namespace Unity.Labs.Utils | Unity Reflect | 1.0.0-preview.11
docs.unity3d.com
    Show / Hide Table of Contents

    Namespace Unity.Labs.Utils

    Classes

    BoundsUtils

    Bounds related utilities

    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

    CoefficientUtils

    CollectionExtensions

    CollectionPool<TCollection, TValue>

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

    ComponentUtils

    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

    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

    EnumValues<T>

    EventAttribute

    GameObjectExtensions

    GameObjectUtils

    Utility methods for creating GameObjects Allows systems to subscribe to gameObjectInstantiated

    GeometryUtils

    HashSetExtensions

    LayerMaskExtensions

    ListExtensions

    MaterialUtils

    Runtime Material utilities

    MathUtility

    MonoBehaviourExtensions

    ObjectPool<T>

    OnDestroyNotifier

    PoseExtensions

    QuaternionExtensions

    ReadOnlyDictionary<K, T>

    Polyfill for the built-in ReadOnlyDictionary type in .Net 4.6, under .Net 3.5 Should function identically to that class, except for a bit of garbage allocation

    ReadOnlyDictionary<K, T>.ValueCollection

    ReflectionUtils

    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>

    StopwatchExtensions

    StringExtensions

    TextureUtils

    Utilities for manipulating Textures

    TransformExtensions

    TypeExtensions

    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

    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

    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