This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Implementation of ISynchronizeInvoke for Unity3D game engine. | |
Can be used to invoke anything on main Unity thread. | |
ISynchronizeInvoke is used extensively in .NET forms, it's is elegant and quite useful in Unity as well. | |
I implemented it so i can use it with System.IO.FileSystemWatcher.SynchronizingObject. | |
help from: http://www.codeproject.com/Articles/12082/A-DelegateQueue-Class | |
example usage: https://gist.github.com/aeroson/90bf21be3fdc4829e631 | |
version: aeroson 2017-07-13 (author yyyy-MM-dd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Runtime.InteropServices; | |
public class VideoPicker : MonoBehaviour { | |
public Texture2D shareButtonImage; // Use this for initialization | |
[DllImport("__Internal")] | |
private static extern void OpenVideoPicker(string game_object_name, string function_name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
// http://en.wikipedia.org/wiki/Dolly_zoom | |
public class DollyZoom : MonoBehaviour | |
{ | |
public Transform target; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class LeapCollider : MonoBehaviour | |
{ | |
void Update() | |
{ | |
var controller = FindObjectOfType<HandController>(); | |
foreach (var hand in controller.hand_physics_) { | |
var fingers = hand.Value.fingers; | |
var thumb = fingers[0].transform; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Scrape income distribution data from whatsmypercent.com | |
# | |
# Output is in incomes.csv (percentile,income) | |
# | |
# start at $100 / year | |
income=100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# The unreasonable effectiveness of Character-level Language Models\n", | |
"## (and why RNNs are still cool)\n", | |
"\n", | |
"###[Yoav Goldberg](http://www.cs.biu.ac.il/~yogo)\n", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
// http://forum.unity3d.com/threads/eventtrigger-move-issue.325103/#post-2114563 | |
public class TrackMouseOverUI: MonoBehaviour, IPointerEnterHandler, IPointerExitHandler | |
{ | |
// Called when the pointer enters our GUI component. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ { youtube: 'http://www.youtube.com/embed/bG3RVtWvIWQ?enablejsapi=1&version=3&hl=en_US&rel=0&wmode=transparent' }, | |
{ youtube: 'http://www.youtube.com/embed/ISAO7QDY3Wo?enablejsapi=1&version=3&hl=en_US&rel=0&wmode=transparent' }, | |
{ youtube: 'http://www.youtube.com/embed/mndofQbvWkw?enablejsapi=1&version=3&hl=en_US&rel=0&wmode=transparent' }, | |
{ youtube: 'http://www.youtube.com/embed/DHv9SFeTIlA?enablejsapi=1&version=3&hl=en_US&rel=0&wmode=transparent' }, | |
{ youtube: 'http://www.youtube.com/embed/ywiGH46arUY?enablejsapi=1&version=3&hl=en_US&rel=0&wmode=transparent' }, | |
{ youtube: 'http://www.youtube.com/embed/NWmFRkccGS8?enablejsapi=1&version=3&hl=en_US&rel=0&wmode=transparent' }, | |
{ youtube: 'http://www.youtube.com/embed/7ZGqfV8xHck?enablejsapi=1&version=3&hl=en_US&rel=0&wmode=transparent' }, | |
{ youtube: 'http://www.youtube.com/embed/2sAU0b3Rajk?enablejsapi=1&version=3&hl=en_US&rel=0&wmode=transparent' }, | |
{ youtube: 'http://www.youtube.com/embed/XR4dYb4dV1M?enablejsapi=1&version=3&hl=en_US&rel=0&wm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
// place on a GameObject with an AudioSource component | |
[RequireComponent(typeof(AudioSource))] | |
public class PlayRandomSound : MonoBehaviour { | |
public AudioClip[] sounds; // assign in inspector | |
// Use this for initialization |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name AssetStoreBuddy | |
// @namespace unitycoder.com | |
// @include https://www.assetstore.unity3d.com/en/#!/search/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
// currently need to press F5 to run these |