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
app.configure(function () { | |
app.use(express.static(__dirname + '/public')); | |
app.use(express.bodyParser()); | |
app.set('views', __dirname); | |
//app.set('view engine', 'jade'); | |
// make a custom html template | |
app.register('.html', { | |
compile: function(str, options){ | |
return function(locals){ | |
return str; |
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 SetSortingLayer : MonoBehaviour | |
{ | |
public string sortingLayerName; | |
public int sortingLayerOrder; | |
void Start() { | |
renderer.sortingLayerName = sortingLayerName; |
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/Glitch" { | |
Properties { | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
} | |
SubShader { | |
Pass { | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag |
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
#Usage I=infile make style | |
style: | |
astyle -c -j --style=google -f -p --unpad-paren -H -D -S $(I) |
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
#Usage I=infile O=outfile make sheet | |
sheet: | |
Texturepacker --format unity --data $(O){v}.txt --sheet $(O){v}.png --variant 1:@2x --force-identical-layout --variant 0.5:@1x --max-width 4096 --max-height 4096 --size-constraints POT --algorithm Basic --basic-order Ascending --basic-sort-by Name --pack-mode Best --border-padding 2 --shape-padding 2 --disable-rotation $(I) |
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
fixed4 TerrainWaveGrass (inout float4 vertex, float waveAmount, fixed4 color) | |
{ | |
float4 _waveXSize = float4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y; | |
float4 _waveZSize = float4 (0.006, .02, 0.02, 0.05) * _WaveAndDistance.y; | |
float4 waveSpeed = float4 (0.3, .5, .4, 1.2) * 4; | |
float4 _waveXmove = float4(0.012, 0.02, -0.06, 0.048) * 2; | |
float4 _waveZmove = float4 (0.006, .02, -0.02, 0.1); | |
float4 waves; |
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 ScreenshotController : MonoBehaviour | |
{ | |
void Update() { | |
if ( Input.GetKeyDown( KeyCode.Alpha1 ) ) { | |
Application.CaptureScreenshot( "ScreenshotSize1.png", 1 ); | |
} | |
if ( Input.GetKeyDown( KeyCode.Alpha2 ) ) { |
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
/** | |
* @file PlayerPrefsSerializer.cs | |
* @brief Code snippet from UnityForum (http://forum.unity3d.com/threads/72156-C-Serialization-PlayerPrefs-mystery) | |
* @author mindlube+FizixMan | |
* @version 1.0 | |
* @date 2012-06-15 | |
*/ | |
using UnityEngine; | |
using System; |
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 UnityEditor; | |
using System.Collections; | |
[InitializeOnLoad] | |
public class PlatformMonitor { | |
static BuildTarget cachedPlatform; | |
static PlatformMonitor() { | |
cachedPlatform = EditorUserBuildSettings.activeBuildTarget; |
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
Library/* | |
Temp/* | |
*.booproj | |
*.csproj | |
*.sln | |
*.userprefs | |
*.pidb | |
*.unityproj | |
.DS_Store |