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
| /* | |
| 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 |
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
| 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'; |
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
| var request = require("request"), | |
| cheerio = require("cheerio"), | |
| url = "https://www.google.com/search?q=data+mining", | |
| corpus = {}, | |
| totalResults = 0, | |
| resultsDownloaded = 0; | |
| function callback () { | |
| resultsDownloaded++; |
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
| 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 |
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
| @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) | |
| */ |
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; | |
| public class dottest : MonoBehaviour { | |
| public Transform p1; | |
| public Transform p2; | |
| public Transform p3; | |
| public GUIText guiDOT; |
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
| // 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; |
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
| // 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)); |
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; | |
| public class PauseMode : MonoBehaviour | |
| { | |
| void Update () | |
| { | |
| if (Input.GetKeyDown ("p")) Time.timeScale = 1-Time.timeScale; | |
| } | |
| } |
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
| // http://unitypatterns.com/scripting-with-coroutines/ | |
| IEnumerator Wait(float duration) | |
| { | |
| for (float timer = 0; timer < duration; timer += Time.deltaTime) | |
| { | |
| yield return 0; | |
| } | |
| } |