Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
// 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?) |
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
%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} |
using UnityEngine; | |
using System.Collections; | |
public class Cat : MonoBehaviour { | |
// declare a public variable, of type Transform, called "mouse" | |
public Transform mouse; | |
bool shouldIPlayASound = false; |
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 { |
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class PrattCards : MonoBehaviour { | |
public Renderer cardPrefab; | |
public List<Texture2D> cardFronts; | |
public int[] cardFrequency; |
// To prepare a Google Spreadsheet for this: | |
// make sure the spreadsheet has been published to web (FILE >> PUBLISH TO WEB), which is NOT the same as sharing to web | |
// To use in a different script: | |
// 1) include "using Google.GData.Client;" | |
// 2) include "using Google.GData.Spreadsheets;" | |
// 3) call "GDocService.GetSpreadsheet( string spreadsheetKey );", see DebugTest section for sample usage | |
using UnityEngine; | |
using System.Collections; |
using UnityEngine; | |
using System.Collections; | |
public class EnvCubemap : MonoBehaviour { | |
public Cubemap cubemap; | |
public int cubemapRes = 128; // powers of two only | |
public CameraClearFlags clearFlags = CameraClearFlags.Color; | |
public Color clearColor = Color.black; | |
public LayerMask cullingMask; | |
public float near = 0.1f; |
IEnumerator ForceDirectGraph<T>( Graph<T> graph, Dictionary<T, Vector3> graphPositions ) { | |
// settings | |
float attractToCenter = 15f; | |
float repulsion = 10f; | |
float spacing = 0.1f; | |
float stiffness = 100f; | |
float damping = 0.9f; | |
// initialize velocities and positions | |
Dictionary<Vertex<T>, Vector2> velocity = new Dictionary<Vertex<T>, Vector2>(); |
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 |