Class Util
Inheritance
System.Object
Util
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Assembly-CSharp.dll
Syntax
Fields
CentimetersToFeet
Declaration
public const float CentimetersToFeet = 0.0328084F
Field Value
Type |
Description |
System.Single |
|
CentimetersToInches
Declaration
public const float CentimetersToInches = 0.393701F
Field Value
Type |
Description |
System.Single |
|
FeetToCentimeters
Declaration
public const float FeetToCentimeters = 30.48F
Field Value
Type |
Description |
System.Single |
|
FeetToMeters
Declaration
public const float FeetToMeters = 0.3048F
Field Value
Type |
Description |
System.Single |
|
InchesToCentimeters
Declaration
public const float InchesToCentimeters = 2.54F
Field Value
Type |
Description |
System.Single |
|
InchesToMeters
Declaration
public const float InchesToMeters = 0.0254F
Field Value
Type |
Description |
System.Single |
|
KilometersToMiles
Declaration
public const float KilometersToMiles = 0.621371F
Field Value
Type |
Description |
System.Single |
|
MetersToFeet
Declaration
public const float MetersToFeet = 3.28084F
Field Value
Type |
Description |
System.Single |
|
MetersToInches
Declaration
public const float MetersToInches = 39.3701F
Field Value
Type |
Description |
System.Single |
|
MilesToKilometers
Declaration
public const float MilesToKilometers = 1.60934F
Field Value
Type |
Description |
System.Single |
|
Methods
AfterTimer(GameObject, Single, Action, Boolean)
Declaration
public static void AfterTimer(GameObject go, float _time, Action callback, bool trigger_if_destroyed_early = false)
Parameters
Type |
Name |
Description |
UnityEngine.GameObject |
go |
|
System.Single |
_time |
|
System.Action |
callback |
|
System.Boolean |
trigger_if_destroyed_early |
|
AngleOf(Vector2)
Declaration
public static float AngleOf(Vector2 v)
Parameters
Type |
Name |
Description |
UnityEngine.Vector2 |
v |
|
Returns
Type |
Description |
System.Single |
|
Approach(Single, Single, Single)
Declaration
public static float Approach(float target, float value, float speed)
Parameters
Type |
Name |
Description |
System.Single |
target |
|
System.Single |
value |
|
System.Single |
speed |
|
Returns
Type |
Description |
System.Single |
|
BezierInterpolate3(Vector3, Vector3, Vector3, Single)
Declaration
public static Vector3 BezierInterpolate3(Vector3 p0, Vector3 c0, Vector3 p1, float t)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
p0 |
|
UnityEngine.Vector3 |
c0 |
|
UnityEngine.Vector3 |
p1 |
|
System.Single |
t |
|
Returns
Type |
Description |
UnityEngine.Vector3 |
|
BezierInterpolate4(Vector3, Vector3, Vector3, Vector3, Single)
Declaration
public static Vector3 BezierInterpolate4(Vector3 p0, Vector3 c0, Vector3 c1, Vector3 p1, float t)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
p0 |
|
UnityEngine.Vector3 |
c0 |
|
UnityEngine.Vector3 |
c1 |
|
UnityEngine.Vector3 |
p1 |
|
System.Single |
t |
|
Returns
Type |
Description |
UnityEngine.Vector3 |
|
ClosestPointOnLine(Vector3, Vector3, Vector3)
Declaration
public static Vector3 ClosestPointOnLine(Vector3 vA, Vector3 vB, Vector3 vPoint)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
vA |
|
UnityEngine.Vector3 |
vB |
|
UnityEngine.Vector3 |
vPoint |
|
Returns
Type |
Description |
UnityEngine.Vector3 |
|
ColorWithAlpha(Color, Single)
Declaration
public static Color ColorWithAlpha(this Color color, float alpha)
Parameters
Type |
Name |
Description |
UnityEngine.Color |
color |
|
System.Single |
alpha |
|
Returns
Type |
Description |
UnityEngine.Color |
|
CombinePaths(String[])
Declaration
public static string CombinePaths(params string[] paths)
Parameters
Type |
Name |
Description |
System.String[] |
paths |
|
Returns
Type |
Description |
System.String |
|
DrawCross(Vector3, Color, Single)
Declaration
public static void DrawCross(Vector3 origin, Color crossColor, float size)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
origin |
|
UnityEngine.Color |
crossColor |
|
System.Single |
size |
|
FastRemove<T>(List<T>, Int32)
Declaration
public static void FastRemove<T>(List<T> list, int index)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<T> |
list |
|
System.Int32 |
index |
|
Type Parameters
FindAndRemove<T>(List<T>, Predicate<T>)
Declaration
public static List<T> FindAndRemove<T>(List<T> list, Predicate<T> match)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<T> |
list |
|
System.Predicate<T> |
match |
|
Returns
Type |
Description |
System.Collections.Generic.List<T> |
|
Type Parameters
Declaration
public static Transform FindChild(Transform parent, string name)
Parameters
Type |
Name |
Description |
UnityEngine.Transform |
parent |
|
System.String |
name |
|
Returns
Type |
Description |
UnityEngine.Transform |
|
FindOrAdd<T>(List<T>, T)
Declaration
public static int FindOrAdd<T>(List<T> list, T item)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<T> |
list |
|
T |
item |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
FindOrAddComponent<T>(GameObject)
Declaration
public static T FindOrAddComponent<T>(GameObject gameObject)
where T : Component
Parameters
Type |
Name |
Description |
UnityEngine.GameObject |
gameObject |
|
Returns
Type Parameters
FixupNewlines(String)
Declaration
public static string FixupNewlines(string text)
Parameters
Type |
Name |
Description |
System.String |
text |
|
Returns
Type |
Description |
System.String |
|
FloatToDecimal(Single, Int32)
Declaration
public static decimal FloatToDecimal(float value, int decimalPlaces = 2)
Parameters
Type |
Name |
Description |
System.Single |
value |
|
System.Int32 |
decimalPlaces |
|
Returns
Type |
Description |
System.Decimal |
|
ForEach<T>(IEnumerable<T>, Action<T>)
Declaration
public static void ForEach<T>(this IEnumerable<T> source, Action<T> action)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
source |
|
System.Action<T> |
action |
|
Type Parameters
GetCommandLineArgValue(String, Int32)
Declaration
public static int GetCommandLineArgValue(string argumentName, int nDefaultValue)
Parameters
Type |
Name |
Description |
System.String |
argumentName |
|
System.Int32 |
nDefaultValue |
|
Returns
Type |
Description |
System.Int32 |
|
GetCommandLineArgValue(String, Single)
Declaration
public static float GetCommandLineArgValue(string argumentName, float flDefaultValue)
Parameters
Type |
Name |
Description |
System.String |
argumentName |
|
System.Single |
flDefaultValue |
|
Returns
Type |
Description |
System.Single |
|
HasCommandLineArgument(String)
Declaration
public static bool HasCommandLineArgument(string argumentName)
Parameters
Type |
Name |
Description |
System.String |
argumentName |
|
Returns
Type |
Description |
System.Boolean |
|
IgnoreCollisions(GameObject, GameObject)
Declaration
public static void IgnoreCollisions(GameObject goA, GameObject goB)
Parameters
Type |
Name |
Description |
UnityEngine.GameObject |
goA |
|
UnityEngine.GameObject |
goB |
|
IsNullOrEmpty<T>(T[])
Declaration
public static bool IsNullOrEmpty<T>(T[] array)
Parameters
Type |
Name |
Description |
T[] |
array |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
IsValidIndex<T>(T[], Int32)
Declaration
public static bool IsValidIndex<T>(T[] array, int i)
Parameters
Type |
Name |
Description |
T[] |
array |
|
System.Int32 |
i |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
IsValidIndex<T>(List<T>, Int32)
Declaration
public static bool IsValidIndex<T>(List<T> list, int i)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<T> |
list |
|
System.Int32 |
i |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
Declaration
public static T Median<T>(this IEnumerable<T> source)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
source |
|
Returns
Type Parameters
Normalize(Single, Single, Single)
Declaration
public static float Normalize(float value, float min, float max)
Parameters
Type |
Name |
Description |
System.Single |
value |
|
System.Single |
min |
|
System.Single |
max |
|
Returns
Type |
Description |
System.Single |
|
PathLength(NavMeshPath)
Declaration
public static float PathLength(NavMeshPath path)
Parameters
Type |
Name |
Description |
UnityEngine.NavMeshPath |
path |
|
Returns
Type |
Description |
System.Single |
|
Quit()
Declaration
public static void Quit()
RandomWithLookback(Int32, Int32, List<Int32>, Int32)
Declaration
public static int RandomWithLookback(int min, int max, List<int> history, int historyCount)
Parameters
Type |
Name |
Description |
System.Int32 |
min |
|
System.Int32 |
max |
|
System.Collections.Generic.List<System.Int32> |
history |
|
System.Int32 |
historyCount |
|
Returns
Type |
Description |
System.Int32 |
|
RemapNumber(Single, Single, Single, Single, Single)
Declaration
public static float RemapNumber(float num, float low1, float high1, float low2, float high2)
Parameters
Type |
Name |
Description |
System.Single |
num |
|
System.Single |
low1 |
|
System.Single |
high1 |
|
System.Single |
low2 |
|
System.Single |
high2 |
|
Returns
Type |
Description |
System.Single |
|
RemapNumberClamped(Single, Single, Single, Single, Single)
Declaration
public static float RemapNumberClamped(float num, float low1, float high1, float low2, float high2)
Parameters
Type |
Name |
Description |
System.Single |
num |
|
System.Single |
low1 |
|
System.Single |
high1 |
|
System.Single |
low2 |
|
System.Single |
high2 |
|
Returns
Type |
Description |
System.Single |
|
ReplaceGameObject<T, U>(T, U)
Declaration
public static void ReplaceGameObject<T, U>(T replace, U replaceWith)
where T : MonoBehaviour where U : MonoBehaviour
Parameters
Type |
Name |
Description |
T |
replace |
|
U |
replaceWith |
|
Type Parameters
Declaration
public static void ResetTransform(Transform t, bool resetScale = true)
Parameters
Type |
Name |
Description |
UnityEngine.Transform |
t |
|
System.Boolean |
resetScale |
|
SendPhysicsMessage(Collider, String, Object, SendMessageOptions)
Declaration
public static void SendPhysicsMessage(Collider collider, string message, object arg, SendMessageOptions sendMessageOptions)
Parameters
Type |
Name |
Description |
UnityEngine.Collider |
collider |
|
System.String |
message |
|
System.Object |
arg |
|
UnityEngine.SendMessageOptions |
sendMessageOptions |
|
SendPhysicsMessage(Collider, String, SendMessageOptions)
Declaration
public static void SendPhysicsMessage(Collider collider, string message, SendMessageOptions sendMessageOptions)
Parameters
Type |
Name |
Description |
UnityEngine.Collider |
collider |
|
System.String |
message |
|
UnityEngine.SendMessageOptions |
sendMessageOptions |
|
SetActive(GameObject, Boolean)
Declaration
public static void SetActive(GameObject gameObject, bool active)
Parameters
Type |
Name |
Description |
UnityEngine.GameObject |
gameObject |
|
System.Boolean |
active |
|
Shuffle<T>(T[])
Declaration
public static void Shuffle<T>(T[] array)
Parameters
Type |
Name |
Description |
T[] |
array |
|
Type Parameters
Shuffle<T>(List<T>)
Declaration
public static void Shuffle<T>(List<T> list)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<T> |
list |
|
Type Parameters
Swap<T>(ref T, ref T)
Declaration
public static void Swap<T>(ref T lhs, ref T rhs)
Parameters
Type |
Name |
Description |
T |
lhs |
|
T |
rhs |
|
Type Parameters
Declaration
public static void SwitchLayerRecursively(Transform transform, int fromLayer, int toLayer)
Parameters
Type |
Name |
Description |
UnityEngine.Transform |
transform |
|
System.Int32 |
fromLayer |
|
System.Int32 |
toLayer |
|
Vector2AsVector3(Vector2)
Declaration
public static Vector3 Vector2AsVector3(Vector2 v)
Parameters
Type |
Name |
Description |
UnityEngine.Vector2 |
v |
|
Returns
Type |
Description |
UnityEngine.Vector3 |
|
Vector2FromString(String)
Declaration
public static Vector2 Vector2FromString(string szString)
Parameters
Type |
Name |
Description |
System.String |
szString |
|
Returns
Type |
Description |
UnityEngine.Vector2 |
|
Vector3AsVector2(Vector3)
Declaration
public static Vector2 Vector3AsVector2(Vector3 v)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
v |
|
Returns
Type |
Description |
UnityEngine.Vector2 |
|
Vector3FromString(String)
Declaration
public static Vector3 Vector3FromString(string szString)
Parameters
Type |
Name |
Description |
System.String |
szString |
|
Returns
Type |
Description |
UnityEngine.Vector3 |
|
WrapCoroutine(IEnumerator, Action)
Declaration
public static IEnumerator WrapCoroutine(IEnumerator coroutine, Action onCoroutineFinished)
Parameters
Type |
Name |
Description |
System.Collections.IEnumerator |
coroutine |
|
System.Action |
onCoroutineFinished |
|
Returns
Type |
Description |
System.Collections.IEnumerator |
|
YawOf(Vector3)
Declaration
public static float YawOf(Vector3 v)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
v |
|
Returns
Type |
Description |
System.Single |
|