Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
public class MoveTransform : IActivated {
public Transform objectMoved;
public Movements activatedPos, deactivatedPos;
[System.Serializable]
public class Movements {
using UnityEngine;
using UnityEditor;
[CustomEditor (typeof(Trigger))]
[CanEditMultipleObjects()]
public class TriggerEditor : Editor
{
private SerializedObject obj;
private SerializedProperty radius;
// C# built-in event system used in Unity3D
//
// Author: Bartek Drozdz
// Reference: http://www.everyday3d.com/blog/index.php/2010/10/04/c-events-and-unity3d/
using UnityEngine;
public class EventDispatcher : MonoBehaviour
{
public delegate void EventHandler(GameObject e);
<canvas id="stage"></canvas>
using UnityEngine;
using System.Collections;
public class CameraOrbit : MonoBehaviour
{
public float angularSpeed = 180;
public float zoomSpeed = 1;
public float sensibility = 6;
Vector2 prevMousePosition;
Shader "Custom/Skybox RGBM HDR Linear" {
Properties {
_Cubemap ("Cubemap", Cube) = "white" {}
_Exposure ("Exposure", Float) = 20.0
}
SubShader {
Tags { "Queue"="Background" "RenderType"="Background" }
Cull Off
ZWrite Off
@keiranlovett
keiranlovett / ExportPBRTextures.jsx
Last active August 29, 2015 14:27 — forked from GetUpKidAK/ExportTextures.jsx
Photoshop script to export textures from layered PSD
// Enables exporting of several PBR maps from a single PSD with a few clicks:
// 1. Select an export folder (default to PSD path on Windows)
// 2. Choose which PSD layer group corresponds to which map (split into separate RGB/Alpha channels)
// 3. Change the file export options (if required)
// 4. Hit export.
#target photoshop
app.bringToFront();
// DEFAULT EXPORT OPTIONS
@keiranlovett
keiranlovett / StopPlayingOnRecompile.cs
Created January 19, 2016 08:05 — forked from zapdot/StopPlayingOnRecompile.cs
Stop Playing on Recompile
using UnityEditor;
[InitializeOnLoad]
public class StopPlayingOnRecompile
{
static StopPlayingOnRecompile()
{
EditorApplication.update = () =>
{
if (EditorApplication.isCompiling && EditorApplication.isPlaying)
@keiranlovett
keiranlovett / DiffuseOverlay.shader
Created January 19, 2016 08:21 — forked from brunomikoski/DiffuseOverlay.shader
Overlay difuse shader (Object Above Everything else)
Shader "Custom/DiffuseOverlay" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
// Tags {"RenderType"="Opaque"} // original
Tags {"Queue" = "Overlay" "RenderType"="Opaque"} // modified
ZTest Always // this line is added
LOD 200
/// <summary>
/// Returns a position on the edge of the screen
/// </summary>
/// <param name="horizontal">0 being left, and 1 being right</param>
/// <param name="vertical">0 being botton, and 1 being top of the screen</param>
/// <param name="horizontalPadding">Padding from the screen, 0 means on screen, and 0.1 will be 10% off the screen</param>
/// <param name="verticalPadding"> </param>
/// <returns></returns>
public Vector3 GetOffScreenPosition(float horizontal,
float vertical,