Search Results for

    Class UnityUtils

    Inheritance
    object
    UnityUtils
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: SonsSdk
    Assembly: SonsSdk.dll
    Syntax
    public static class UnityUtils

    Methods

    AddOrGet<T>(GameObject)

    Get a component or adds it to the gameobject if it doesn't exist

    Declaration
    public static T AddOrGet<T>(this GameObject go) where T : Component
    Parameters
    Type Name Description
    GameObject go
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    ToSprite(Texture2D)

    Convert a texture to a sprite. This is a slow operation. Make sure to cache the result.

    Declaration
    public static Sprite ToSprite(this Texture2D tex)
    Parameters
    Type Name Description
    Texture2D tex
    Returns
    Type Description
    Sprite