blob: c99749523b3fd3ca2d98c34940790510fe724d8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class MathUtils
{
public static Vector2 Abs(Vector2 v)
{
return new Vector2(Mathf.Abs(v.x), Mathf.Abs(v.y));
}
public static Vector2 Max(Vector2 src, float v)
{
return new Vector2(Mathf.Max(src.x, v), Mathf.Max(src.y, v));
}
public static void Swap(ref float f1, ref float f2)
{
float t = f1;
f1 = f2;
f2 = t;
}
}
|