Skip to content

Instantly share code, notes, and snippets.

View samsheffield's full-sized avatar
🏠
Homing from work

Sam Sheffield samsheffield

🏠
Homing from work
View GitHub Profile
@samsheffield
samsheffield / QuitAndReset.cs
Created October 9, 2020 19:03
Basic example of quit and reset functionality in Unity 3D
// Simple quit and escape functionality
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// First, add this...
using UnityEngine.SceneManagement;
public class QuitAndReset : MonoBehaviour
@samsheffield
samsheffield / ProTrinketKeyboardEmulator.ino
Last active September 27, 2017 12:40
Basic keyboard example for Adafruit Pro Trinket with simultaneous input
// This requires Adafruit's Pro Trinket Keyboard library
#include <ProTrinketKeyboard.h>
// Array to hold keypresses.
uint8_t pressedKeys[9];
void setup() {
// Each pin uses internal pullup resistors
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
@samsheffield
samsheffield / TrinketKeyboardEmulator.ino
Last active September 22, 2017 13:00
Basic keyboard example for Adafruit Trinket with simultaneous input
// 3 button keyboard emulator for the 5V Adafruit Trinket.
// Requires the Trinket Keyboard Library from Adafruit (https://github.com/adafruit/Adafruit-Trinket-USB/archive/master.zip)
#include <TrinketKeyboard.h>
// Array to hold keypresses. Trinket can emulate 3 simultaneously pressed keys
uint8_t pressedKeys[3];
void setup() {
// Each pin* uses internal pullup resistors
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting