Struct Vector4Int
Represents a four-dimensional vector of integer components, and provides
implicit and explicit conversions to and from Unity's UnityEngine.Vector2,
UnityEngine.Vector3, UnityEngine.Vector4, and UnityEngine.Color.
Assembly: TriLibCore.dll
Syntax
public struct Vector4Int : IList<int>, ICollection<int>, IEnumerable<int>, IEnumerable
Constructors
Vector4Int(int, int, int, int)
Initializes a new instance of the Vector4Int struct
with the specified x, y,
z, and w components.
Declaration
public Vector4Int(int x, int y, int z, int w)
Parameters
| Type |
Name |
Description |
| int |
x |
The X component value.
|
| int |
y |
The Y component value.
|
| int |
z |
The Z component value.
|
| int |
w |
The W component value.
|
Fields
w
The W component of the vector.
Declaration
Field Value
x
The X component of the vector.
Declaration
Field Value
y
The Y component of the vector.
Declaration
Field Value
z
The Z component of the vector.
Declaration
Field Value
Properties
Count
Declaration
public int Count { get; }
Property Value
IsReadOnly
Declaration
public bool IsReadOnly { get; }
Property Value
this[int]
Gets or sets the component at the specified index.
Declaration
public int this[int index] { get; set; }
Parameters
| Type |
Name |
Description |
| int |
index |
A zero-based index of the component to get or set.
|
Property Value
Exceptions
Methods
Add(int)
Declaration
public void Add(int item)
Parameters
| Type |
Name |
Description |
| int |
item |
|
Clear()
Declaration
Contains(int)
Declaration
public bool Contains(int item)
Parameters
| Type |
Name |
Description |
| int |
item |
|
Returns
CopyTo(int[], int)
Declaration
public void CopyTo(int[] array, int arrayIndex)
Parameters
| Type |
Name |
Description |
| int[] |
array |
|
| int |
arrayIndex |
|
GetEnumerator()
Declaration
public IEnumerator<int> GetEnumerator()
Returns
IndexOf(int)
Declaration
public int IndexOf(int item)
Parameters
| Type |
Name |
Description |
| int |
item |
|
Returns
Insert(int, int)
Declaration
public void Insert(int index, int item)
Parameters
| Type |
Name |
Description |
| int |
index |
|
| int |
item |
|
Remove(int)
Declaration
public bool Remove(int item)
Parameters
| Type |
Name |
Description |
| int |
item |
|
Returns
RemoveAt(int)
Declaration
public void RemoveAt(int index)
Parameters
| Type |
Name |
Description |
| int |
index |
|
Operators
explicit operator Vector4Int(Color)
Explicitly converts a UnityEngine.Color to a Vector4Int,
interpreting each color channel as an integer component.
Declaration
public static explicit operator Vector4Int(Color b)
Parameters
| Type |
Name |
Description |
| Color |
b |
The UnityEngine.Color to convert.
|
Returns
explicit operator Vector4Int(Vector2)
Explicitly converts a UnityEngine.Vector2 to a Vector4Int,
setting the X and Y components and defaulting Z and W to zero.
Declaration
public static explicit operator Vector4Int(Vector2 b)
Parameters
| Type |
Name |
Description |
| Vector2 |
b |
The UnityEngine.Vector2 to convert.
|
Returns
explicit operator Vector4Int(Vector3)
Explicitly converts a UnityEngine.Vector3 to a Vector4Int,
setting the X, Y, and Z components and defaulting W to zero.
Declaration
public static explicit operator Vector4Int(Vector3 b)
Parameters
| Type |
Name |
Description |
| Vector3 |
b |
The UnityEngine.Vector3 to convert.
|
Returns
explicit operator Vector4Int(Vector4)
Explicitly converts a UnityEngine.Vector4 to a Vector4Int,
setting all four integer components.
Declaration
public static explicit operator Vector4Int(Vector4 b)
Parameters
| Type |
Name |
Description |
| Vector4 |
b |
The UnityEngine.Vector4 to convert.
|
Returns
implicit operator Color(Vector4Int)
Implicitly converts a Vector4Int to a UnityEngine.Color.
Each integer component x, y, z, w is cast to a float for the respective color channel.
Declaration
public static implicit operator Color(Vector4Int b)
Parameters
Returns
implicit operator Vector2(Vector4Int)
Implicitly converts a Vector4Int to a UnityEngine.Vector2,
discarding the Z and W components.
Declaration
public static implicit operator Vector2(Vector4Int b)
Parameters
Returns
implicit operator Vector3(Vector4Int)
Implicitly converts a Vector4Int to a UnityEngine.Vector3,
discarding the W component.
Declaration
public static implicit operator Vector3(Vector4Int b)
Parameters
Returns
implicit operator Vector4(Vector4Int)
Implicitly converts a Vector4Int to a UnityEngine.Vector4.
Declaration
public static implicit operator Vector4(Vector4Int b)
Parameters
Returns
Implements
Extension Methods