This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ushort bitMaskValue = left * 8 + down * 4 + right * 2 + up * 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Encrypt data with AesCryptoServiceProvider, which should use FIPS 140-2 compliant library | |
/// </summary> | |
/// <param name="key"></param> | |
/// <param name="IV"></param> | |
/// <param name="data"></param> | |
/// <returns></returns> | |
public byte[] EncryptDataAESCryptoServiceProvider(byte[] key, byte[] IV, object data) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************* | |
* 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |