Class Util.Struct
Unity struct converter.
Unity struct 轉換器。
Inheritance
Namespace: Votanic
Assembly: Votanic.Core.dll
Syntax
public class Struct
Methods
ToColor(Single[])
Convert to Color.
轉換為顏色。
ToColor(1, 1, 1, 1)
Declaration
public static Color ToColor(params float[] color)
Parameters
Type | Name | Description |
---|---|---|
System.Single[] | color | Numbers |
Returns
Type | Description |
---|---|
UnityEngine.Color |
ToFloatArray(Color)
Convert from Color.
將顏色轉換。
ToFloatArray(Color.white)
Declaration
public static float[] ToFloatArray(Color color)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Color | color | Color |
Returns
Type | Description |
---|---|
System.Single[] |
ToFloatArray(Color, Single)
Convert from Color and Alpha.
將顏色及不透明度轉換。
ToFloatArray(Color.white, 1)
Declaration
public static float[] ToFloatArray(Color color, float alpha)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Color | color | Color |
System.Single | alpha | Alpha value |
Returns
Type | Description |
---|---|
System.Single[] |
ToFloatArray(Quaternion)
Convert from Quaternion.
將四元素轉換。
ToFloatArray(Quaternion.identity)
Declaration
public static float[] ToFloatArray(Quaternion quaternion)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Quaternion | quaternion | Quaternion |
Returns
Type | Description |
---|---|
System.Single[] |
ToFloatArray(Vector2)
Convert from Vector2.
將二元向量轉換。
FromVector2(Vector2.one)
Declaration
public static float[] ToFloatArray(Vector2 vector)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector2 | vector | Vector2 |
Returns
Type | Description |
---|---|
System.Single[] |
ToFloatArray(Vector3)
Convert from Vector3.
將三元向量轉換。
ToFloatArray(Vector3.one)
Declaration
public static float[] ToFloatArray(Vector3 vector)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | vector | Vector3 |
Returns
Type | Description |
---|---|
System.Single[] |
ToFloatArray(Vector4)
Convert from Vector4.
將四元向量轉換。
ToFloatArray(Vector4.one)
Declaration
public static float[] ToFloatArray(Vector4 vector)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector4 | vector | Vector4 |
Returns
Type | Description |
---|---|
System.Single[] |
ToIntArray(Vector2Int)
Convert from Vector2Int.
將二元整數向量轉換。
ToIntArray(Vector2Int.one)
Declaration
public static int[] ToIntArray(Vector2Int vector)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector2Int | vector | Vector2Int |
Returns
Type | Description |
---|---|
System.Int32[] |
ToIntArray(Vector3Int)
Convert from Vector3Int.
將三元整數向量轉換。
ToIntArray(Vector3Int.one)
Declaration
public static int[] ToIntArray(Vector3Int vector)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3Int | vector | Vector3Int |
Returns
Type | Description |
---|---|
System.Int32[] |
ToQuaternion(Single[])
Convert to Quaternion.
轉換為四元素。
ToQuaternion(0, 0, 0, 1)
Declaration
public static Quaternion ToQuaternion(params float[] quaternion)
Parameters
Type | Name | Description |
---|---|---|
System.Single[] | quaternion | Numbers |
Returns
Type | Description |
---|---|
UnityEngine.Quaternion |
ToVector2(Int32[])
Convert to Vector2Int.
轉換為二元整數向量。
ToVector2(1, 2)
Declaration
public static Vector2Int ToVector2(params int[] vector)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | vector | Numbers |
Returns
Type | Description |
---|---|
UnityEngine.Vector2Int |
ToVector2(Single[])
Convert to Vector2.
轉換為二元向量。
ToVector2(1, 2)
Declaration
public static Vector2 ToVector2(params float[] vector)
Parameters
Type | Name | Description |
---|---|---|
System.Single[] | vector | Numbers |
Returns
Type | Description |
---|---|
UnityEngine.Vector2 |
ToVector3(Int32[])
Convert to Vector3Int.
轉換為三元整數向量。
ToVector3(1, 2, 3)
Declaration
public static Vector3Int ToVector3(params int[] vector)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | vector | Numbers |
Returns
Type | Description |
---|---|
UnityEngine.Vector3Int |
ToVector3(Single[])
Convert to Vector3.
轉換為三元向量。
ToVector3(1, 2, 3)
Declaration
public static Vector3 ToVector3(params float[] vector)
Parameters
Type | Name | Description |
---|---|---|
System.Single[] | vector | Numbers |
Returns
Type | Description |
---|---|
UnityEngine.Vector3 |
ToVector4(Single[])
Convert to Vector4.
轉換為四元向量。
ToVector4(1, 2, 3, 4)
Declaration
public static Vector4 ToVector4(params float[] vector)
Parameters
Type | Name | Description |
---|---|---|
System.Single[] | vector | Numbers |
Returns
Type | Description |
---|---|
UnityEngine.Vector4 |