Skip to content

Instantly share code, notes, and snippets.

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

JT5D JT5D

💭
Multiversing...
View GitHub Profile
@JT5D
JT5D / ShapeRecognizer.cs
Last active August 29, 2015 14:25 — forked from hecomi/Detector.cs
図形を認識するヤツ
/*
The MIT License (MIT)
Copyright (c) 2014 hecomi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@JT5D
JT5D / server.js
Last active August 29, 2015 14:25 — forked from hecomi/server.js
SimSimi API と Web Speech API と Unity をつなげるやつ
var http = require('http');
var https = require('https');
var querystring = require('querystring');
var fs = require('fs');
var ws = require('ws').Server;
var wss = [];
var HTTPS_PORT = 23456;
var UNITY_PORT = 12345;
var HTML_PATH = 'index.html';
@JT5D
JT5D / topkeywords.js
Last active August 29, 2015 14:25 — forked from elliotbonneville/topkeywords.js
Find top keywords associated with a Google search with this Node.js application.
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
Shader "Custom/Light rays" {
Properties {
_MainTex ("Rays texture", 2D) = "white" {}
_speed ("Speed", Float) = 0.2
}
Category {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
Blend SrcAlpha One
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("forum.unity3d.com") {
/*
Unity3D Forums Style (to make the new forums bit more easier to read..)
Stylish plugin for Firefox : https://addons.mozilla.org/en-US/firefox/addon/stylish/
WORK-IN-PROGRESS (Feel Free To Fork/Suggest new css)
*/
using UnityEngine;
using System.Collections;
public class dottest : MonoBehaviour {
public Transform p1;
public Transform p2;
public Transform p3;
public GUIText guiDOT;
// Rotate sprite/object towards mouse : http://johnstejskal.com/wp/rotating-objects-and-sprites-in-unity3d-using-cs-c/
using UnityEngine;
using System.Collections;
public class RotateSpriteTowardsMouse : MonoBehaviour
{
private Camera cam;
// quad pos: 0.5, 0.5, 0
// quad scale: 2, 1, 0
// texture size: 1280x720
Vector3 wPos = new Vector3(x,y,0); // x,y = texture pixel pos
float localX = wPos.x*2 / tex.width - 0.5f * 2; // 2 = quad transform scale
float localY = wPos.y / tex.height - 0.5f * 1;
wPos = transform.TransformPoint(new Vector3(localX, localY, 0));
using UnityEngine;
using System.Collections;
public class PauseMode : MonoBehaviour
{
void Update ()
{
if (Input.GetKeyDown ("p")) Time.timeScale = 1-Time.timeScale;
}
}
// http://unitypatterns.com/scripting-with-coroutines/
IEnumerator Wait(float duration)
{
for (float timer = 0; timer < duration; timer += Time.deltaTime)
{
yield return 0;
}
}