Search Results for

    Show / Hide Table of Contents

    Class ObjectExtensions

    Inheritance
    object
    ObjectExtensions
    Namespace: TetraCreations.Core
    Assembly: cs.temp.dll.dll
    Syntax
    public static class ObjectExtensions

    Methods

    As<T>(object)

    Casts anonymous type to the specified type.

    Declaration
    public static T As<T>(this object source) where T : class
    Parameters
    Type Name Description
    object source

    The object

    Returns
    Type Description
    T

    The object as the specified type.

    Type Parameters
    Name Description
    T

    Generic type parameter. The specified type.

    GetTypeAndName(Object, string)

    Returns the type and the object name.

    Declaration
    public static string GetTypeAndName(this UnityEngine.Object source, string separator = " : ")
    Parameters
    Type Name Description
    UnityEngine.Object source
    string separator
    Returns
    Type Description
    string

    IsAssignableFrom(object, Type)

    Determines if an object is assignable from a targeted type.

    Declaration
    public static bool IsAssignableFrom(this object source, Type targetType)
    Parameters
    Type Name Description
    object source

    The object

    Type targetType

    Type of the target.

    Returns
    Type Description
    bool

    true if assignable from, false if not.

    IsAssignableFrom<T>(object)

    Determines if an object is assignable from.

    Declaration
    public static bool IsAssignableFrom<T>(this object source)
    Parameters
    Type Name Description
    object source

    The object

    Returns
    Type Description
    bool

    true if assignable from, false if not.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    IsIn<T>(T, params T[])

    Declaration
    public static bool IsIn<T>(this T source, params T[] list)
    Parameters
    Type Name Description
    T source
    T[] list
    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T

    IsNotNull<T>(T)

    Returns true if the object is not null, false otherwise.

    Declaration
    public static bool IsNotNull<T>(this T source) where T : class
    Parameters
    Type Name Description
    T source
    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T

    IsNull<T>(T)

    Returns true if the object is null, false otherwise.

    Declaration
    public static bool IsNull<T>(this T source) where T : class
    Parameters
    Type Name Description
    T source
    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T

    Null<T>(T)

    Returns the object itself if it exists, null otherwise.

    Declaration
    public static T Null<T>(this T self) where T : UnityEngine.Object
    Parameters
    Type Name Description
    T self
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T
    In This Article
    Back to top Tetra Creations documentation