Unity-DebugX/Runtime/Internal/Extensions.cs

32 lines
747 B
C#
Raw Normal View History

2025-02-22 17:25:54 +08:00
using UnityEngine;
namespace DCFApixels.DebugXCore.Internal
{
2025-07-23 19:16:24 +08:00
internal static class Extensions
2025-02-22 17:25:54 +08:00
{
public static Color SetAlpha(this Color self, float v)
{
self.a *= v;
return self;
}
2025-04-08 18:25:45 +08:00
public static Color ToColor(ref this (Color color, float alpha) self)
{
self.color.a *= self.alpha;
return self.color;
}
2025-07-23 19:16:24 +08:00
public static Vector3 Mult(this Vector3 a, Vector3 b)
{
a.x *= b.x;
a.y *= b.y;
a.z *= b.z;
return a;
}
public static Vector2 Mult(this Vector2 a, Vector2 b)
{
a.x *= b.x;
a.y *= b.y;
return a;
}
2025-02-22 17:25:54 +08:00
}
}