Class CommonExtensions
Inheritance
CommonExtensions
Assembly: SonsSdk.dll
Syntax
public static class CommonExtensions
Methods
Destroy<T>(GameObject)
Declaration
public static void Destroy<T>(this GameObject go) where T : Component
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Type Parameters
DontDestroyOnLoad(GameObject)
Declaration
public static GameObject DontDestroyOnLoad(this GameObject go)
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Returns
Type |
Description |
GameObject |
|
FindGet<T>(GameObject, string)
Gets a transform by path and return a component on it
Declaration
public static T FindGet<T>(this GameObject go, string name) where T : Component
Parameters
Type |
Name |
Description |
GameObject |
go |
|
string |
name |
The path of the transform to get
|
Returns
Type Parameters
Name |
Description |
T |
The type of the component to get
|
FirstContains<T>(IEnumerable<T>, string)
Declaration
public static T FirstContains<T>(this IEnumerable<T> iter, string name) where T : Object
Parameters
Returns
Type Parameters
FirstEndsWith<T>(IEnumerable<T>, string)
Declaration
public static T FirstEndsWith<T>(this IEnumerable<T> iter, string name) where T : Object
Parameters
Returns
Type Parameters
FirstStartsWith<T>(IEnumerable<T>, string)
Declaration
public static T FirstStartsWith<T>(this IEnumerable<T> iter, string name) where T : Object
Parameters
Returns
Type Parameters
FirstWithName<T>(IEnumerable<T>, string)
Declaration
public static T FirstWithName<T>(this IEnumerable<T> iter, string name) where T : Object
Parameters
Returns
Type Parameters
HideAndDontSave(GameObject)
Declaration
public static GameObject HideAndDontSave(this GameObject go)
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Returns
Type |
Description |
GameObject |
|
Instantiate(GameObject, bool)
Declaration
public static GameObject Instantiate(this GameObject go, bool sameParent = false)
Parameters
Type |
Name |
Description |
GameObject |
go |
|
bool |
sameParent |
|
Returns
Type |
Description |
GameObject |
|
Instantiate(GameObject, Vector3, bool)
Declaration
public static GameObject Instantiate(this GameObject go, Vector3 position, bool sameParent = false)
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Vector3 |
position |
|
bool |
sameParent |
|
Returns
Type |
Description |
GameObject |
|
Instantiate(GameObject, Vector3, Quaternion, bool)
Declaration
public static GameObject Instantiate(this GameObject go, Vector3 position, Quaternion rotation, bool sameParent = false)
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Vector3 |
position |
|
Quaternion |
rotation |
|
bool |
sameParent |
|
Returns
Type |
Description |
GameObject |
|
InstantiateAndGet<T>(GameObject, bool)
Declaration
public static T InstantiateAndGet<T>(this GameObject go, bool sameParent = false) where T : Component
Parameters
Type |
Name |
Description |
GameObject |
go |
|
bool |
sameParent |
|
Returns
Type Parameters
InstantiateAndGet<T>(GameObject, Vector3, bool)
Declaration
public static T InstantiateAndGet<T>(this GameObject go, Vector3 position, bool sameParent = false) where T : Component
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Vector3 |
position |
|
bool |
sameParent |
|
Returns
Type Parameters
InstantiateAndGet<T>(GameObject, Vector3, Quaternion, bool)
Declaration
public static T InstantiateAndGet<T>(this GameObject go, Vector3 position, Quaternion rotation, bool sameParent = false) where T : Component
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Vector3 |
position |
|
Quaternion |
rotation |
|
bool |
sameParent |
|
Returns
Type Parameters
SetName(GameObject, string)
Declaration
public static GameObject SetName(this GameObject go, string name)
Parameters
Type |
Name |
Description |
GameObject |
go |
|
string |
name |
|
Returns
Type |
Description |
GameObject |
|
Declaration
public static GameObject SetParent(this GameObject go, Transform parent, bool worldPositionStays = false)
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Transform |
parent |
|
bool |
worldPositionStays |
|
Returns
Type |
Description |
GameObject |
|
ToUnityColor(Color)
Declaration
public static Color ToUnityColor(this Color color)
Parameters
Type |
Name |
Description |
Color |
color |
|
Returns
WithAlpha(Color, float)
Declaration
public static Color WithAlpha(this Color color, float alpha)
Parameters
Type |
Name |
Description |
Color |
color |
|
float |
alpha |
|
Returns
WithBrightness(Color, float)
Declaration
public static Color WithBrightness(this Color color, float brightness)
Parameters
Type |
Name |
Description |
Color |
color |
|
float |
brightness |
|
Returns
WithBrightnessOffset(Color, float)
Declaration
public static Color WithBrightnessOffset(this Color color, float brightnessOffset)
Parameters
Type |
Name |
Description |
Color |
color |
|
float |
brightnessOffset |
|
Returns