Skip to content

Instantly share code, notes, and snippets.

View tim-hub's full-sized avatar
:octocat:
Patience is Love

Tim tim-hub

:octocat:
Patience is Love
View GitHub Profile
// Copyright (c) 2012 Calvin Rien
// http://the.darktable.com
//
// This software is provided 'as-is', without any express or implied warranty. In
// no event will the authors be held liable for any damages arising from the use
// of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
@tim-hub
tim-hub / AssetBundleSample.cs
Created April 18, 2016 03:43 — forked from yaeda/AssetBundleSample.cs
Unity AssetBundle Examples.
using System;
using UnityEngine;
using System.Collections;
public class AssetBundleSample : MonoBehaviour {
public GUIText guitext;
// Use this for initialization
void Start () {
@tim-hub
tim-hub / check long press.cs
Created April 7, 2016 06:21
check long press on touch screen
bool CheckForLongPress() {
if (Input.touches[0].phase == TouchPhase.Began) { // If the user puts her finger on screen...
_timePressed = Time.time - _timeLastPress;
}
if (Input.touches[0].phase == TouchPhase.Ended) { // If the user raises her finger from screen
_timeLastPress = Time.time;
if (_timePressed > WaitingSeconds/2f) { // Is the time pressed greater than our time delay threshold?
return true;
}
@tim-hub
tim-hub / AutoSnap.cs
Created January 8, 2016 03:32 — forked from estebanpadilla/AutoSnap.cs
Auto snap to grid in Unity If you need to auto snap a gameObject to the grid in unity this script will help you. Usage: Create a Editor folder in your assets folder. Add the AutoSnap.cs script to the Editor folder. To open press Command + L (Mal), Control + L (PC) Source: http://answers.unity3d.com/questions/148812/is-there-a-toggle-for-snap-to-…
using UnityEngine;
using UnityEditor;
public class AutoSnap : EditorWindow
{
private Vector3 prevPosition;
private bool doSnap = true;
private float snapValue = 1;
[MenuItem( "Edit/Auto Snap %_l" )]
@tim-hub
tim-hub / springer-free-maths-books.md
Created December 29, 2015 04:08 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@tim-hub
tim-hub / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console