Class UnityUtils
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 Parameters
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