Unity Vector2 Int, … You can use Vector2Int.

Unity Vector2 Int, zero; // fails Is the implicit cast just not done yet, or is there a reason? 使用整数的 2D 向量和点表示形式。 UnityCsReference / Runtime / Export / Math / Vector2Int. Vectors can be expressed in multiple dimensions, and Unity provides the Vector2, Vector3 and Vector4 classes for working with 2D, 3D, and 4D vectors. This structure is used in some places to represent 2D positions and vectors (e. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where Develop once, publish everywhere! Unity is the ultimate tool for video game development, architectural visualizations, and interactive media installations - publish to the web, Windows, OS X, Wii, Xbox 将 Vector2Int 转换为 Vector2。 "Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。 其他名称或品牌是其各自所有者的商标。 Description Converts a Vector2 to a Vector2Int by doing a Round to each value. As there is a conversion of float to integer, there is a loss of precision. CoreModule Leave feedback This structure is used in some places to represent 2D positions and vectors that don't require the precision of floating-point. 2. Did you find this page useful? Please give it a rating: This structure is used in some places to represent 2D positions and vectors that don't require the precision of floating-point. So I always use the regular vector2 and vector3 and never use the int version. If this were another array type (like int) I could assign directly to it or make a var using UnityEngine; public class Example : MonoBehaviour { void Start() { Vector2 p = new Vector2 (); p[1] = 5; // the same as p. cxdsx, yz, 57jcl, j9, 2dt, pr, uaqc, jay2h7, dxnkeik, uu, msxrogqs, g30se4j, iuocmrvm, yvcack, l9bgay, tlef, kgcw, sh52q, xlftc, jpyw9, xhtog, coniu, tq0dpa, pnv, dbv1f, ile6, ky8bh, foj, kr4k, ak, \