Class CustomUnityExtensions
- Namespace
- Root
- Assembly
- SPZGameAssembly.dll
public static class CustomUnityExtensions
- Inheritance
-
object
CustomUnityExtensions
Methods
DeleteBySwappingWithLast_ForwardIteration<T>(List<T>, ref int)
public static void DeleteBySwappingWithLast_ForwardIteration<T>(this List<T> list, ref int index)
Parameters
list List<T>
index int
Type Parameters
T
FirstOrDefault<T>(IReadOnlyList<T>)
[Pure]
public static T FirstOrDefault<T>(this IReadOnlyList<T> list)
Parameters
list IReadOnlyList<T>
Returns
- T
Type Parameters
T
FirstOrDefault<T>(IReadOnlyList<T>, Func<T, bool>)
[Pure]
public static T FirstOrDefault<T>(this IReadOnlyList<T> list, Func<T, bool> predicate)
Parameters
list IReadOnlyList<T>
predicate Func<T, bool>
Returns
- T
Type Parameters
T
GetOrAddComponent<T>(GameObject)
public static T GetOrAddComponent<T>(this GameObject gameObject) where T : Component
Parameters
gameObject GameObject
Returns
- T
Type Parameters
T
public static Vector2 GetSnapToPositionToBringChildIntoView(this ScrollRect instance, RectTransform child)
Parameters
instance ScrollRect
child RectTransform
Returns
- Vector2
LerpArray(Color[], float)
public static Color LerpArray(this Color[] arr, float factor)
Parameters
arr Color[]
factor float
Returns
- Color
RandomChoice<T>(List<T>)
public static T RandomChoice<T>(this List<T> list)
Parameters
list List<T>
Returns
- T
Type Parameters
T
RandomChoice<T>(List<T>, ref Random)
public static T RandomChoice<T>(this List<T> list, ref Random rng)
Parameters
list List<T>
rng Random
Returns
- T
Type Parameters
T
RandomChoice<T>(T[])
public static T RandomChoice<T>(this T[] arr)
Parameters
arr T[]
Returns
- T
Type Parameters
T
RandomChoice<T>(T[], ref Random)
public static T RandomChoice<T>(this T[] arr, ref Random rng)
Parameters
arr T[]
rng Random
Returns
- T
Type Parameters
T
public static void RemoveAllChildren(this Transform t, bool keepTaggedChildren = true)
Parameters
t Transform
keepTaggedChildren bool
SetActiveSelfExt(GameObject, bool)
public static void SetActiveSelfExt(this GameObject obj, bool active)
Parameters
obj GameObject
active bool
public static void SetHeight(this RectTransform t, float sizeY)
Parameters
t RectTransform
sizeY float
public static void SetLocalPositionXOnly(this Transform t, float x)
Parameters
t Transform
x float
public static void SetLocalPositionYOnly(this Transform t, float y)
Parameters
t Transform
y float
public static void SetPositionXOnly(this Transform t, float x)
Parameters
t Transform
x float
public static void SetPositionYOnly(this Transform t, float y)
Parameters
t Transform
y float
public static void SetWidth(this RectTransform t, float sizeX)
Parameters
t RectTransform
sizeX float
public static Bounds TransformBounds(this Bounds bounds, Matrix4x4 matrix)
Parameters
bounds Bounds
matrix Matrix4x4
Returns
- Bounds