Skip to content

Instantly share code, notes, and snippets.

View donsledzion's full-sized avatar

Adam Chojaczyk donsledzion

View GitHub Profile
@kurtdekker
kurtdekker / HeadNodYesSensor.cs
Last active February 16, 2024 10:21
Head shake no and nod yes gesture detector
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// @kurtdekker - head nod yes sensor
//
// To use:
// Put this on a mouse-controlled FPS camera and it can detect:
// - up/down "head nods yes."
// Optionally give it an audio to play
#if UNITY_EDITOR
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Little utility for opening a "Game" view in fullscreen. Will be opened on whatever Unity thinks is the "main"
/// monitor at the moment. The hotkey will toggle the window; however, if for some reason this breaks, fullscreen
@luke161
luke161 / Singleton.cs
Last active June 20, 2024 15:20
Unity MonoBehaviour Singleton. Base class for creating a singleton in Unity, handles searching for an existing instance, useful if you've created the instance inside a scene. Also handles cleaning up of multiple singleton instances in Awake.
/**
* Singleton.cs
* Author: Luke Holland (http://lukeholland.me/)
*/
using UnityEngine;
public class Singleton<T> : MonoBehaviour where T : MonoBehaviour
{