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 "Stencils/Masks/StencilMask" | |
| { | |
| Properties{ | |
| _MainTex("Base (RGB) Trans (A)", 2D) = "white" {} | |
| _Stencil("Stencil ID", Int) = 0 | |
| } | |
| SubShader | |
| { |
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
| float fmap(float x, float in_min, float in_max, float out_min, float out_max) { | |
| return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; | |
| } |
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
| public class CameraUtil { | |
| public static void AdjustCustomProjectionClipPlanes(Camera sourceCamera){ | |
| Matrix4x4 projMatix = sourceCamera.projectionMatrix; | |
| //-(far + near) / (far - near) | |
| float m22 = projMatix.m22; | |
| //-(2.0F * far * near) / (far - near); | |
| float m23 = projMatix.m23; |
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 System; | |
| public class AppArgs { | |
| public static T GetNamedArgument<T>(string key,T defaultValue) { | |
| string[] args = Environment.GetCommandLineArgs(); | |
| int index = -1; | |
| for(int i=0; i<args.Length-1; i++ ){ | |
| if( args[i] == key ){ | |
| index = i+1; | |
| break; |
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 psi = new ProcessStartInfo("shutdown","/s /t 0"); | |
| psi.CreateNoWindow = true; | |
| psi.UseShellExecute = false; | |
| Process.Start(psi); |
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 System; | |
| using UnityEngine; | |
| public class DllLoadingAtRuntimeExample : MonoBehaviour | |
| { | |
| static IntPtr nativeLibraryPtr; | |
| delegate int MultiplyFloat(float number, float multiplyBy); | |
| delegate void DoSomething(string words); | |
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 SavePrefab : MonoBehaviour { | |
| } |
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
| We wonder,—and some Hunter may express | |
| Wonder like ours, when thro' the wilderness | |
| Where London stood, holding the Wolf in chace, | |
| He meets some fragment huge, and stops to guess | |
| What powerful but unrecorded race | |
| Once dwelt in that annihilated place. |
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
| [System.Serializable] | |
| public class GyroControls{ | |
| public Vector3 clampRotation = new Vector3(30f,30f,30f); | |
| public Vector3 deadZone = new Vector3(3f,3f,3f); | |
| Quaternion startRotation; | |
| bool touching; | |
| Vector3 mRotation; |
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 range=function(x,y,z){ if(typeof(y)=='undefined'){y=x;x=0};if(typeof(z)=='undefined')z=1;var a=new Array(Math.floor(y-x)/z);for(var i=0;z*i<(y-x);i++)a[i]=(z*i)+x;return a } |