View BoidRigidbody2D.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Rigidbody2D), typeof(Collider2D))]
public class BoidRigidbody2D : MonoBehaviour
{
//our boid's rigidbody
public Rigidbody2D thisRigidbody2D;
View Boids.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Boids : MonoBehaviour {
//predefined array to keep unity GC low
private Collider2D[] surroundingCollidersNonAlloc = new Collider2D[10];
private int surroundingColliderNonAllocLength = 0;
//filtered array of surrounding units, predefinied to keep GC low.
View SimpleVRPlayerController.cs
/*************************************************************************
* SimpleVRPlayerController created by Chris @ ChrisHammond.ca
* __________________
*
* Usage: Please feel free to use this code for your own personal or commercial
* projects if it helps or is any benefit to you.
*
*
*/
using System.Collections;
View Simple2DTargetScanner.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Simple2DTargetScanner : MonoBehaviour
{
public float scanFrequency; //in seconds
public float scanRadius = 5; //in world units
private float scanFrequencyCounter = 0; //counter for time between scans