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
| //This API to create new nodes has been deprecated in early 2019. | |
| //This means that if you are on a more recent version of Shader Graph and Universal Render Pipeline, you should use instead a pre-made node, which acts like a container that allows you to inject custom HLSL code into Shader Graph without the need to create a node from scratch. | |
| //Please use the new node, not the C# API described here. | |
| // | |
| //You can find more details about that node in the Docs: https://docs.unity3d.com/Packages/com.unity.shadergraph@6.7/manual/Custom-Function-Node.html | |
| //I also blogged about it here: https://connect.unity.com/p/adding-your-own-hlsl-code-to-shader-graph-the-custom-function-node | |
| // | |
| //If you are still on a very old version of Lightweight Render Pipeline (you shouldn't!!), you can still see the C# code for this custom node by rolling back to a previous version. |
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
| <!DOCTYPE html> | |
| <html lang="en-us"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Unity WebGL Player | WebTest</title> | |
| <script src="Build/UnityLoader.js"></script> | |
| <style> | |
| body{ |
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 Universal Render Pipeline you can you the ShaderGraph which is super AWESOME! | |
| // However, if you want to author shaders in shading language you can use this teamplate as a base. | |
| // Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader. | |
| // This shader works with URP 7.1.x and above | |
| Shader "Universal Render Pipeline/Custom/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
| // Put this in an editor folder | |
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEditor; | |
| using UnityEngine; | |
| using UnityEngine.Experimental.LowLevel; | |
| using UnityEngine.Profiling; |
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 UnityEngine.UI; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| /// <summary> | |
| /// Add this component to your Cinemachine Virtual Camera to have it shake when calling its ShakeCamera methods. | |
| /// </summary> | |
| public class CinemachineCameraShaker : 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
| // A simple Unity example script that makes a UI component track position of world space object rendered with | |
| // specific world space camera. Canvas needs to be in Screen Space Camera mode. | |
| [ExecuteInEditMode] | |
| public class UIFollow : MonoBehaviour | |
| { | |
| [Tooltip("World space object to follow")] | |
| public GameObject target; | |
| [Tooltip("World space camera that renders the target")] | |
| public Camera worldCamera; | |
| [Tooltip("Canvas set in Screen Space Camera mode")] |
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
| /* | |
| Send and receive OSC messages between NodeMCU and another OSC speaking device. | |
| Send Case: Press a physical button (connected to NodeMCU) and get informed about it on your smartphone screen | |
| Receive Case: Switch an LED (connected to NodeMCU) on or off via Smartphone | |
| Written by Jackson Campbell <jcampbell@calarts.edu> | |
| Modified by Donovan Keith <dkeith@calarts.edu> | |
| for [Augmenting Realities](https://sites.google.com/view/augmentingrealities/home) | |
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 GyroCamera : MonoBehaviour | |
| { | |
| // STATE | |
| private float _initialYAngle = 0f; | |
| private float _appliedGyroYAngle = 0f; | |
| private float _calibrationYAngle = 0f; | |
| private Transform _rawGyroRotation; |
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
| /************************************************************ | |
| * Better Singleton by David Darias | |
| * Use as you like - credit where due would be appreciated :D | |
| * Licence: WTFPL V2, Dec 2014 | |
| * Tested on Unity v5.6.0 (should work on earlier versions) | |
| * 03/02/2017 - v1.1 | |
| * **********************************************************/ | |
| using System; | |
| using UnityEngine; |
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 class Colors | |
| { | |
| // NOTE: The follwing color names come from the CSS3 specification, Section 4.3 Extended Color Keywords | |
| // http://www.w3.org/TR/css3-color/#svg-color | |
| public static readonly Color AliceBlue = new Color32(240,248,255,255); | |
| public static readonly Color AntiqueWhite = new Color32(250,235,215,255); | |
| public static readonly Color Aqua= new Color32(0,255,255,255); |