This file contains 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 MoveTransform : IActivated { | |
public Transform objectMoved; | |
public Movements activatedPos, deactivatedPos; | |
[System.Serializable] | |
public class Movements { |
This file contains 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; | |
[CustomEditor (typeof(Trigger))] | |
[CanEditMultipleObjects()] | |
public class TriggerEditor : Editor | |
{ | |
private SerializedObject obj; | |
private SerializedProperty radius; |
This file contains 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
// 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); |
This file contains 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
<canvas id="stage"></canvas> |
This file contains 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 CameraOrbit : MonoBehaviour | |
{ | |
public float angularSpeed = 180; | |
public float zoomSpeed = 1; | |
public float sensibility = 6; | |
Vector2 prevMousePosition; |
This file contains 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/Skybox RGBM HDR Linear" { | |
Properties { | |
_Cubemap ("Cubemap", Cube) = "white" {} | |
_Exposure ("Exposure", Float) = 20.0 | |
} | |
SubShader { | |
Tags { "Queue"="Background" "RenderType"="Background" } | |
Cull Off | |
ZWrite Off |
This file contains 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
// 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 |
This file contains 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 UnityEditor; | |
[InitializeOnLoad] | |
public class StopPlayingOnRecompile | |
{ | |
static StopPlayingOnRecompile() | |
{ | |
EditorApplication.update = () => | |
{ | |
if (EditorApplication.isCompiling && EditorApplication.isPlaying) |
This file contains 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/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 |
This file contains 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
/// <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, |
OlderNewer