This file contains 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
%YAML 1.1 | |
%TAG !u! tag:unity3d.com,2011: | |
--- !u!1 &121470 | |
GameObject: | |
m_ObjectHideFlags: 0 | |
m_PrefabParentObject: {fileID: 0} | |
m_PrefabInternal: {fileID: 100100000} | |
serializedVersion: 4 | |
m_Component: | |
- 224: {fileID: 22423080} |
This file contains 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/Gamma Image Effect" { | |
Properties | |
{ | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_SaturationAmount ("Saturation Amount", Range(0.0, 1.0)) = 1.0 | |
_BrightnessAmount ("Brightness Amount", Range(0.0, 1.0)) = 1.0 | |
_ContrastAmount ("Contrast Amount", Range(0.0,1.0)) = 1.0 | |
} | |
SubShader | |
{ |
This file contains 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 UnityEditor; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
using System.IO.Compression; | |
using Ionic.Zip; // this uses the Unity port of DotNetZip https://github.com/r2d2rigo/dotnetzip-for-unity |
This file contains 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
// a not-cheap but not-expensive water shader | |
// decent quality DX9 2012-era water, by Robert Yang (@radiatoryang) | |
// based on: | |
// built-in legacy Alpha-Bumped shader | |
// added cubemap reflection and rimlight stuff | |
// GlassStainedBumpDistort from Unity glass refraction demo | |
// http://forum.unity3d.com/threads/grabtexture-uv-correction-in-surface-shader.67742/ | |
// ... this does NOT have fogging or edge blending (too expensive / annoying?) |
This file contains 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 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.UI; | |
// usage: place on a UI Text object to visualize spreadsheet data | |
// preparing a Google Doc: make sure you go to File >> Publish... "Share" does NOT work for this | |
// publicly editable: https://docs.google.com/spreadsheets/d/1QDaGFXxh3zbVTcQKXygKZ67_EFXjUlGbHbK21ICvv-k/edit?usp=sharing | |
// view as HTML: https://docs.google.com/spreadsheets/d/1QDaGFXxh3zbVTcQKXygKZ67_EFXjUlGbHbK21ICvv-k/pubhtml |
This file contains 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; | |
// full reference: http://docs.unity3d.com/ScriptReference/WWW.html | |
// usage: place this on a gameObject with Mesh Filter and Mesh Renderer (e.g. a Quad, a Plane, a Cube) | |
// NOTE: this does NOT work in Web Player (browser security sandbox) | |
public class DemoWebcam : MonoBehaviour { |
This file contains 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.Collections.Generic; // STEP 1 OF USING A LIST: include this line | |
// a "List" is like an Array | |
// an array = "immutable", it cannot be resized | |
// a list = dynamically resizable, elastic, will stretch or shrink based on item count | |
// demo: I'm going to instantiate spheres, track the spheres using a list, and | |
// modify all of the spheres inside the list |
This file contains 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; | |
// put this script on an object with a COLLIDER | |
public class LookColorChange : MonoBehaviour { | |
// ALL CODE IN "ONLOOK" WILL HAPPEN EVERY FRAME THIS THING IS LOOKED AT | |
void OnLook () { | |
// if we look in console, we should see this message | |
Debug.Log ("this thing is getting looked at!!!"); |
This file contains 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; | |
// DIRECTIONS FOR USE: | |
// put this script on ForwardDirection gameObject in your Oculus camera rig | |
// it will automatically call a function named "functionToCallOnLook" | |
// on every script component on that object (the object needs a collider too) | |
public class LookCast : MonoBehaviour { |