From my test, the best way to do it is manual assign its value by yourself.
Vector2 vector2;
vector2.x = vector3.x;
vector2.y = vector3.y;
This is my result that I extend from Mattias.
TestConvertByOperation 10000000 instances: 0.3220527s
TestConvertByCasting 10000000 instances: 0.3226218s
TestConvertByInitializing 10000000 instances: 0.1916729s
TestConvertByManualAssign 10000000 instances: 0.09500527s
using UnityEngine;
namespace myTest
{
public class test: MonoBehaviour
{
readonly int iterations = 10000000;
Vector3 testVector = new Vector3(3f, 14f, 42f);
void Start()
{
Debug.Log(string.Format("TestConvertByOperation {0} instances: {1}s", iterations, TestConvertByOperation()));
Debug.Log(string.Format("TestConvertByCasting {0} instances: {1}s", iterations, TestConvertByCasting()));
Debug.Log(string.Format("TestConvertByInitializing {0} instances: {1}s", iterations, TestConvertByInitializing()));
Debug.Log(string.Format("TestConvertByManualAssign {0} instances: {1}s", iterations, TestConvertByManualAssign()));
}
float TestConvertByOperation()
{
var timeStart = Time.realtimeSinceStartup;
Vector2 v2;
for (int i = 0; i < iterations; i++)
{
v2 = testVector;
}
return Time.realtimeSinceStartup - timeStart;
}
float TestConvertByCasting()
{
var timeStart = Time.realtimeSinceStartup;
Vector2 v2;
for (int i = 0; i < iterations; i++)
{
v2 = (Vector2)testVector;
}
return Time.realtimeSinceStartup - timeStart;
}
float TestConvertByInitializing()
{
var timeStart = Time.realtimeSinceStartup;
Vector2 v2;
for (int i = 0; i < iterations; i++)
{
v2 = new Vector2(testVector.x, testVector.y);
}
return Time.realtimeSinceStartup - timeStart;
}
float TestConvertByManualAssign()
{
var timeStart = Time.realtimeSinceStartup;
Vector2 v2;
for (int i = 0; i < iterations; i++)
{
v2.x = testVector.x;
v2.y = testVector.y;
}
return Time.realtimeSinceStartup - timeStart;
}
}
}
Please note, I test it with unity version 5.6.5