Skip to content

Instantly share code, notes, and snippets.

JOSEPH: Did I hear a dog? What's your dog's name?
+ CONWAY: His name is Homer.
~ dog_name = "Homer"
JOSEPH: Bit of a shuffle or a drag in Homer's step — kind of an old one isn't he?
+ CONWAY: Her name is Blue.
~ dog_name = "Blue"
JOSEPH: Blue sounds like a sweet old hound. I used to know a dog like that.
DialogWindow.Display("JOSEPH: Did I hear a dog? What's your dog's name?");
if(DialogWindow.Button("CONWAY: His name is Homer.")) {
dog_name = "Homer";
DialogWindow.Display("JOSEPH: Bit of a shuffle or a drag in Homer's step — kind of an old one isn't he?");
} else if(DialogWindow.Button("CONWAY: Her name is Blue.")) {
dog_name = "Blue";
DialogWindow.Display("JOSEPH: Blue sounds like a sweet old hound. I used to know a dog like that.");
}
import themidibus.*;
MidiBus launchpad;
MidiBus wavetable;
int LED_OFF = 12;
int LED_RED_LOW = 13;
int LED_RED_FULL = 15;
int LED_AMBER_LOW = 29;
int LED_AMBER_FULL = 63;
using UnityEngine;
public class FastForwardButton : MonoBehaviour
{
void Update()
{
if(Application.isEditor && Input.GetKeyDown(KeyCode.F))
{
if(Time.timeScale == 1)
Time.timeScale = 7;
@jakevsrobots
jakevsrobots / PingPongTransformAnimation.cs
Created September 29, 2014 14:21
PingPongTransformAnimation
using UnityEngine;
using System.Collections;
public class PingPongTransformAnimation : MonoBehaviour
{
public enum Easing { None, Hermite, Sinerp, Coserp, Berp, SmoothStep,
CircleLerp };
public Easing easing = Easing.None;
public Vector3 positionChangePerSecond;
@jakevsrobots
jakevsrobots / PrefabGenerator.cs
Created September 29, 2014 14:21
PrefabGenerator
using UnityEngine;
using System.Collections;
public class PrefabGenerator : MonoBehaviour
{
public GameObject prefab;
public Transform position;
public string triggerTag;
void OnTriggerEnter(Collider other)
using UnityEngine;
using System.Collections;
public class AnimateTransform : MonoBehaviour
{
public float speed = 1;
public Vector3 positionChangePerSecond;
public Vector3 rotationChangePerSecond;
public Vector3 scaleChangePerSecond;
@jakevsrobots
jakevsrobots / Flashlight.cs
Created November 25, 2013 21:29
Script to toggle a flashlight on and off. Attach this component to an object with a spotlight component. Add an AudioSource so the switch sound will play. Also remember to adjust the ambient color of the scene for darkness: (Edit->Render Settings->Ambient color).
using UnityEngine;
using System.Collections;
public class Flashlight : MonoBehaviour {
public AudioClip switchSound;
void Update () {
if(Input.GetKeyDown(KeyCode.F))
{
audio.PlayOneShot(switchSound);
@jakevsrobots
jakevsrobots / Conversation.cs
Created November 25, 2013 21:27
A very simple dialog/conversation system using Unity's GUI functions.
using UnityEngine;
using System.Collections;
public class Conversation : MonoBehaviour {
public GUISkin skin;
string scene = "start";
void OnGUI()
{
@jakevsrobots
jakevsrobots / Footsteps.cs
Last active December 29, 2015 09:19
Footsteps with randomness. Attach this to the first-person controller and add an AudioSource component.
using UnityEngine;
using System.Collections;
public class Footsteps : MonoBehaviour {
public AudioClip[] footsteps;
public CharacterController controller;
float stepTimer = 0;
int lastIndex = 0;