Struct Vector4Int
Represents a four-dimensional vector of integer components, and provides
implicit and explicit conversions to and from Unity's Vector2,
Vector3, Vector4, and Color.
Assembly: TriLibCore.Source.dll
Syntax
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 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 Color to convert.
|
Returns
explicit operator Vector4Int(Vector2)
Explicitly converts a 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
Returns
explicit operator Vector4Int(Vector3)
Explicitly converts a 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
Returns
explicit operator Vector4Int(Vector4)
Declaration
public static explicit operator Vector4Int(Vector4 b)
Parameters
Returns
implicit operator Color(Vector4Int)
Implicitly converts a Vector4Int to a 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)
Declaration
public static implicit operator Vector2(Vector4Int b)
Parameters
Returns
implicit operator Vector3(Vector4Int)
Declaration
public static implicit operator Vector3(Vector4Int b)
Parameters
Returns
implicit operator Vector4(Vector4Int)
Declaration
public static implicit operator Vector4(Vector4Int b)
Parameters
Returns
Extension Methods