Skip to content

Instantly share code, notes, and snippets.

Chris MrChrisHammond

Block or report user

Report or block MrChrisHammond

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
MrChrisHammond / TileBitmaskCalculation.cs
Created Sep 5, 2018
Simple bitmask calculation example for tiles
View TileBitmaskCalculation.cs
ushort bitMaskValue = left * 8 + down * 4 + right * 2 + up * 1;
View CryptoTools.cs
/// <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)
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.
MrChrisHammond / SimpleVRPlayerController.cs
Created Aug 29, 2017
A simple Android VR Player Controller for Handheld Joystick Input.
View SimpleVRPlayerController.cs
* SimpleVRPlayerController created by Chris @
* __________________
* 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;
MrChrisHammond / Simple2DTargetScanner.cs
Last active Jul 20, 2017
Simple 2D Target Scanner for Unity
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
You can’t perform that action at this time.