Class Polyfills
- Namespace
- JLChnToZ.VRC.Foundation
Polyfills for compatibility with older versions of Unity and .NET.
public static class Polyfills
- Inheritance
-
Polyfills
- Inherited Members
Methods
Contains(string, string, StringComparison)
(Added in .NET Standard 2.1) Check if the string contains the specified value.
public static bool Contains(this string s, string value, StringComparison comparationType)
Parameters
sstringThe string to check.
valuestringThe value to check.
comparationTypeStringComparisonThe comparison type.
Returns
- bool
trueif the string contains the value; otherwise,false.
GetLocalPositionAndRotation(Transform, out Vector3, out Quaternion)
(Added in Unity 2021.3) Get the local position and rotation of the transform.
public static void GetLocalPositionAndRotation(this Transform transform, out Vector3 localPosition, out Quaternion localRotation)
Parameters
transformTransformThe transform to get the local position and rotation from.
localPositionVector3The local position of the transform.
localRotationQuaternionThe local rotation of the transform.
GetPositionAndRotation(Transform, out Vector3, out Quaternion)
(Added in Unity 2021.3) Get the position and rotation of the transform.
public static void GetPositionAndRotation(this Transform transform, out Vector3 position, out Quaternion rotation)
Parameters
transformTransformThe transform to get the position and rotation from.
positionVector3The position of the transform.
rotationQuaternionThe rotation of the transform.
SetLocalPositionAndRotation(Transform, Vector3, Quaternion)
(Added in Unity 2021.3) Set the local position and rotation of the transform.
public static void SetLocalPositionAndRotation(this Transform transform, Vector3 localPosition, Quaternion localRotation)
Parameters
transformTransformThe transform to set the local position and rotation to.
localPositionVector3The local position to set.
localRotationQuaternionThe local rotation to set.
TryDequeue<T>(Queue<T>, out T)
(Added in .NET Standard 2.1) Try to dequeue an item from the queue.
public static bool TryDequeue<T>(this Queue<T> queue, out T result)
Parameters
queueQueue<T>The queue to dequeue from.
resultTThe dequeued item.
Returns
- bool
trueif the queue is not empty; otherwise,false.
Type Parameters
TThe type of the item in the queue.
TryPeek<T>(Queue<T>, out T)
(Added in .NET Standard 2.1) Try to peek an item from the queue.
public static bool TryPeek<T>(this Queue<T> queue, out T result)
Parameters
queueQueue<T>The queue to peek from.
resultTThe peeked item.
Returns
- bool
trueif the queue is not empty; otherwise,false.
Type Parameters
TThe type of the item in the queue.
TryPeek<T>(Stack<T>, out T)
(Added in .NET Standard 2.1) Try to peek an item from the stack.
public static bool TryPeek<T>(this Stack<T> stack, out T result)
Parameters
stackStack<T>The stack to peek from.
resultTThe peeked item.
Returns
- bool
trueif the stack is not empty; otherwise,false.
Type Parameters
TThe type of the item in the stack.
TryPop<T>(Stack<T>, out T)
(Added in .NET Standard 2.1) Try to pop an item from the stack.
public static bool TryPop<T>(this Stack<T> stack, out T result)
Parameters
stackStack<T>The stack to pop from.
resultTThe popped item.
Returns
- bool
trueif the stack is not empty; otherwise,false.
Type Parameters
TThe type of the item in the stack.