Rasagar/Library/PackageCache/com.unity.visualeffectgraph/Editor/Controls/VFXVector2Field.cs
2024-08-26 23:07:20 +03:00

34 lines
805 B
C#

using UnityEngine;
namespace UnityEditor.VFX.UI
{
class VFXVector2Field : VFXVectorNField<Vector2>
{
protected override int componentCount => 2;
protected override void SetValueComponent(ref Vector2 value, int i, float componentValue)
{
switch (i)
{
case 0:
value.x = componentValue;
break;
default:
value.y = componentValue;
break;
}
}
protected override float GetValueComponent(ref Vector2 value, int i)
{
switch (i)
{
case 0:
return value.x;
default:
return value.y;
}
}
}
}