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.
| Shader "Tri-Planar World" { | |
| Properties { | |
| _Side("Side", 2D) = "white" {} | |
| _Top("Top", 2D) = "white" {} | |
| _Bottom("Bottom", 2D) = "white" {} | |
| _SideScale("Side Scale", Float) = 2 | |
| _TopScale("Top Scale", Float) = 2 | |
| _BottomScale ("Bottom Scale", Float) = 2 | |
| } | |
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.
| /* copyright Robert Yang 2013 | |
| use at your own risk | |
| */ | |
| using UnityEngine; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| public class GLShape : MonoBehaviour { // all-purpose interface for drawing stuff, PUT THIS ON YOUR CAMERA OBJECT | |
| static Material lineMaterial; // init in Start() |
| 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>(); |
| Shader "Nature/Terrain/Diffuse" { | |
| Properties { | |
| [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {} | |
| [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {} | |
| [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {} | |
| [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {} | |
| [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {} | |
| // used in fallback on old cards & base map | |
| [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {} | |
| [HideInInspector] _Color ("Main Color", Color) = (1,1,1,1) |
| // 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; |
| // courtesy of Tale of Tales! | |
| string WordWrap(string text, int lineLength) { | |
| for (int i = lineLength; i < text.Length; i += lineLength) { | |
| int returnSpot = text.LastIndexOf(" ", i); | |
| if (returnSpot >= 0){ | |
| text = text.Substring(0, returnSpot) + "\n" + text.Substring(returnSpot, text.Length-returnSpot); | |
| i = returnSpot; | |
| } | |
| } | |
| return text; |
| using UnityEngine; | |
| using System.Collections; | |
| // THIS CODE IS FULL OF ERRORS! DEBUG IT! | |
| // 0) first, copy and paste this into a file in a Unity project | |
| // 1) read the comments and variable names to figure out the coder's intention | |
| // 2) go to the "Console" tab in Unity, look for stop sign icons -- these are code compile errors. | |
| // the error will tell you the filename, then the line number and column, e.g. "GuessingGame.cs (8,100)" | |
| // 3) double-click on an error in the Console to go to it in MonoDevelop |
| using System; | |
| using System.Runtime.Serialization; | |
| using System.Runtime.Serialization.Formatters.Binary; | |
| using System.Reflection; | |
| using System.Text; | |
| using System.IO; | |
| using UnityEngine; | |
| using System.Collections; | |
| using System.Collections.Generic; |