using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ScreenspaceDragDrop : MonoBehaviour
{
public Camera mCamera;
public Canvas canvas;
using UnityEditor;
using UnityEngine;
public class DirectionGizmos : MonoBehaviour
{
public Transform target;
public Color color = Color.red;
public float thickness = 2;
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
// When creating shaders for Lightweight Pipeline you can you the ShaderGraph which is super AWESOME! | |
// However, if you want to author shaders in shading language you can use this simplified version as a base. | |
// Please not this should be only use for reference only. | |
// It doesn't match neither performance not feature completeness of Lightweight Pipeline Standard shader. | |
Shader "LightweightPipeline/Physically Based Example" | |
{ | |
Properties | |
{ | |
// Specular vs Metallic workflow | |
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0 |
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
//https://docs.unity3d.com/Manual/SL-UnityShaderVariables.html | |
//https://github.com/TwoTailsGames/Unity-Built-in-Shaders/blob/master/CGIncludes/UnityCG.cginc - Most interesting stuff ;) | |
//https://github.com/TwoTailsGames/Unity-Built-in-Shaders/tree/master/CGIncludes | |
//https://docs.unity3d.com/Manual/SL-Shader.html | |
//http://developer.download.nvidia.com/CgTutorial/cg_tutorial_appendix_e.html | |
//https://unity3d.com/how-to/shader-profiling-and-optimization-tips | |
//https://docs.unity3d.com/Manual/SL-UnityShaderVariables.html | |
//http://www.deepskycolors.com/archive/2010/04/21/formulas-for-Photoshop-blending-modes.html | |
//http://www.iquilezles.org/blog/ | |
//Properties |
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 "Name" { | |
Properties { | |
_Name ("display name", Range (min, max)) = number | |
_Name ("display name", Float) = number | |
_Name ("display name", Int) = number | |
_Name ("display name", Color) = (number,number,number,number) | |
_Name ("display name", Vector) = (number,number,number,number) |
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
// Used to generate Texture Array asset | |
// Menu button is available in GameObject > Create Texture Array | |
// See CHANGEME in the file | |
using UnityEngine; | |
using UnityEditor; | |
public class TextureArray : MonoBehaviour { | |
[MenuItem("GameObject/Create Texture Array")] | |
static void Create() |
UNITY_DECLARE_TEX2DARRAY(name)
UNITY_SAMPLE_TEX2DARRAY(name,coord) // coord is float3
On DX11-like systems (DX11, and I'd assume XB1/PS4) the macros expand to:
#define UNITY_DECLARE_TEX2DARRAY(name) Texture2DArray(name); SamplerState sampler##name
#define UNITY_SAMPLE_TEX2DARRAY(name,coord) name.Sample(coord)
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/Texture2DArraySurfaceShader" | |
{ | |
Properties | |
{ | |
_Textures("Textures", 2DArray) = "" {} | |
} | |
SubShader | |
{ | |
Tags { "RenderType"="Opaque" } |
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.Collections.Generic; | |
using UnityEngine; | |
//Invokes the notificaton method | |
public class Subject : MonoBehaviour | |
{ | |
//A list with observers that are waiting for something to happen | |
public List<Observer> observers = new List<Observer>(); | |
private void Start() |
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; | |
public abstract class Observer : MonoBehaviour | |
{ | |
public abstract void OnNotify(); | |
} |