The float2 Equals method is used to determine if two float2 objects have the same value. It returns a Boolean value indicating whether the values of the two objects are equal or not. Here are some brief examples of how to use it:
Example 1:
float2 a = new float2(1.5f, 2.5f); float2 b = new float2(1.5f, 2.5f); bool areEqual = a.Equals(b); // returns true
This example creates two float2 objects, a and b, with the same values. The Equals method is called on a and passed b as a parameter. The method returns true because the values of a and b are equal.
Example 2:
float2 c = new float2(1.5f, 2.5f); float2 d = new float2(3.5f, 4.0f); bool areEqual = c.Equals(d); // returns false
In this example, two float2 objects, c and d, are created with different values. The Equals method is called on c and passed d as a parameter. The method returns false because the values of c and d are not equal.
The float2 Equals method is part of the Unity.Mathematics package library.
C# (CSharp) float2.Equals - 26 examples found. These are the top rated real world C# (CSharp) examples of float2.Equals extracted from open source projects. You can rate examples to help us improve the quality of examples.