Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections.Generic;
using System;
public class Math3d {
private static Transform tempChild = null;
private static Transform tempParent = null;
private static Vector3[] positionRegister;
@vasyaPP
vasyaPP / fgRandom.cs
Created September 27, 2017 17:56
C# Mersenne Twister implementation
/***************************
* fgRandom.cs
*
* C# Mersenne Twister implementation
*
* Based on https://en.wikipedia.org/wiki/Mersenne_Twister
*
* (c) Francois GUIBERT
* www.frozax.com
*
@vasyaPP
vasyaPP / gist:6d88aee67ae6361c0a47e469894528c8
Created August 1, 2017 08:30
Unity MonoBehaviour Singleton
using UnityEngine;
/// <summary>
/// Be aware this will not prevent a non singleton constructor
/// such as `T myT = new T();`
/// To prevent that, add `protected T () {}` to your singleton class.
///
/// As a note, this is made as MonoBehaviour because we need Coroutines.
/// </summary>
public class Singleton<T> : MonoBehaviour where T : MonoBehaviour