More cleanup making code cleaner, made Rectangle Boundaries automatically size to camera's view, automatic random boid placement, value tweaking

This commit is contained in:
Xevion
2020-05-16 22:01:15 -05:00
parent 2dffcdcf3b
commit aaec1923eb
7 changed files with 236 additions and 42 deletions

11
Assets/Util.cs Normal file
View File

@@ -0,0 +1,11 @@
using UnityEngine;
public class Util {
public static Vector2 RotateBy(Vector2 v, float a) {
var ca = Mathf.Cos(a);
var sa = Mathf.Sin(a);
var rx = v.x * ca - v.y * sa;
return new Vector2((float) rx, (float) (v.x * sa + v.y * ca));
}
}