当使用Vector2时,需要明确指定使用哪个类型。比如说,如果要使用UnityEngine中的Vector2,在使用时需要加上命名空间UnityEngine:
using UnityEngine;
// ...
Vector2 myVector2 = new Vector2(1, 2);
如果要使用System.Numerics中的Vector2,则需要在使用时加上命名空间System.Numerics:
using System.Numerics;
// ...
Vector2 myVector2 = new Vector2(1, 2);