Skip to content

Instantly share code, notes, and snippets.

View SnugglePilot's full-sized avatar
🏠
Working from home

Andy Moore SnugglePilot

🏠
Working from home
View GitHub Profile
using UnityEngine;
using System.Collections;
/// <summary>
/// Requires Chevy's unitypatterns.com AutoMotion and Signals.
/// </summary>
public class MoveViewScript : MonoBehaviour {
// REQUIRED:
// This is the object that will swivel on click, such as the camera
using UnityEngine;
using System.Collections;
public class DRM : MonoBehaviour {
private long drmTime;
// Use this for initialization
void Start () {
if (!PlayerPrefs.HasKey("drm")) {
drmTime = System.DateTime.UtcNow.Ticks;
It is GoKit, the thing that is the secret. It is totally just GoKit. Get goKit today.
GoKit
https://github.com/prime31/GoKit/wiki
using UnityEngine;
using System.Collections;
public class DrawCircle : MonoBehaviour
{
public LineRenderer lineRenderer;
public int segments = 20;
public float xradius = 5;
public float yradius = 5;
using UnityEngine;
using System.Collections;
public class DrawCircle : MonoBehaviour
{
public LineRenderer lineRenderer;
private int segments = 10;
private float xradius = 3;
private float yradius = 3;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class NoisyButton : Button {
// Trying to find out when the button is "activated":
/*
public override void OnPointerClick(PointerEventData d) {
// Only triggers on mouse-click.
@SnugglePilot
SnugglePilot / gist:1128805
Created August 5, 2011 23:58 — forked from kevinpeno/gist:1128700
SQL to get all recipes that contain all ingredients the user has
CREATE VIEW view_recipe_by_ingredient AS
SELECT R.id, R.name, RI.liquorID
FROM recipes R
JOIN recipeIngredients RI ON RI.recipeID = R.id;
CREATE VIEW view_recipes_in_cabinet AS
SELECT L.userID, RbI.name, RbI.id, COUNT( RbI.liquorID ) as LiquorCount
FROM view_recipe_by_ingredient RbI
LEFT JOIN liquorCabinet L USING (liquorID)
GROUP BY RbI.name;
@SnugglePilot
SnugglePilot / gist:1128882
Created August 6, 2011 01:26
Sample Data for SQL Ingredient Selection
GOAL:
To create a database of liquor in your liquor cabinet, and a database of possible drinks to make.
Output:
(1) a list of drinks you can make with your existing liquors, (hard!) and
(2) a list of drinks you could make if you just bought a few more things
===
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.IO;
public class SubmitFormOnline : MonoBehaviour {
public InputField textReference;
public string pendingDir;
// FormID comes from the google drive ID, eg:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.IO;
public class SaveFormToDisk : MonoBehaviour {
public InputField textReference;
public string saveDir;
public void SaveToFile(string text, string subDir) {