Skip to content

Instantly share code, notes, and snippets.

View JT5D's full-sized avatar
💭
Multiversing...

JT5D JT5D

💭
Multiversing...
View GitHub Profile
@JakubNei
JakubNei / DeferredSynchronizeInvoke.cs
Last active December 29, 2024 10:46
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.
/*
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)
@naojitaniguchi
naojitaniguchi / VideoPicker.cs
Last active September 15, 2020 10:17
Video Picker for Unity iOS native plugin call sample, Using UIImagePickerController
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);
@unitycoder
unitycoder / DollyZoom.cs
Last active April 11, 2019 15:24
DollyZoom
using UnityEngine;
using System.Collections;
// http://en.wikipedia.org/wiki/Dolly_zoom
public class DollyZoom : MonoBehaviour
{
public Transform target;
@hecomi
hecomi / LeapFinger.cs
Last active August 29, 2015 14:22
指取るやつ
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;
@jhofman
jhofman / scrape_income_dist.sh
Last active August 29, 2015 14:22
You Draw It
#!/bin/bash
#
# Scrape income distribution data from whatsmypercent.com
#
# Output is in incomes.csv (percentile,income)
#
# start at $100 / year
income=100
@yoavg
yoavg / lm_example
Created May 22, 2015 23:43
Unreasonable Effectiveness of LMs
{
"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",
@unitycoder
unitycoder / TrackMouseOverUI.cs
Created May 17, 2015 17:23
Get mouseposition over UI element
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.
@hecomi
hecomi / oculus-mobile-vr-jam.js
Created May 14, 2015 16:58
Oculus' Mobile VR Jam の作品リスト
[ { 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
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
@unitycoder
unitycoder / AssetStoreBuddy.js
Last active August 29, 2015 14:20
UnityAssetStoreBuddy
// ==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