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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class MeshDestroy : MonoBehaviour | |
| { | |
| private bool edgeSet = false; | |
| private Vector3 edgeVertex = Vector3.zero; | |
| private Vector2 edgeUV = Vector2.zero; |
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
| using UnityEngine; | |
| using System.Collections; | |
| // Author: Eric Eastwood (ericeastwood.com) | |
| // | |
| // Description: | |
| // Written for this gd.se question: http://gamedev.stackexchange.com/a/75748/16587 | |
| // Simulates/Emulates pendulum motion in code | |
| // Works in any 3D direction and with any force/direciton of gravity | |
| // |
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; | |
| public class MathParabola | |
| { | |
| public static Vector3 Parabola(Vector3 start, Vector3 end, float height, float t) | |
| { | |
| Func<float, float> f = x => -4 * height * x * x + 4 * height * x; |
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
| // Full shader example demonstrating how to use a quaterionion to rotate a vertex around a specific point. Note that this is just a plain | |
| // vanilla unlit shader which includes the necessary functions (see section below) and example code in the vertex shader. | |
| // | |
| // Forked from https://gist.github.com/nkint/7449c893fb7d6b5fa83118b8474d7dcb | |
| // Converted from GLSL to Cg. For help with that, see https://alastaira.wordpress.com/2015/08/07/unity-shadertoys-a-k-a-converting-glsl-shaders-to-cghlsl/ | |
| // | |
| // quaternion code from https://github.com/stackgl/gl-quat | |
| // rotation from https://twistedpairdevelopment.wordpress.com/2013/02/11/rotating-a-vector-by-a-quaternion-in-glsl/ | |
| Shader "Unlit/Quaternion" |
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 imported from https://docs.chaosgroup.com/display/OSLShaders/Thin+Film+Shader | |
| Shader "Custom/ThinFilmIridescence" { | |
| Properties { | |
| _Color ("Color", Color) = (1,1,1,1) | |
| _MainTex ("Albedo (RGB)", 2D) = "white" {} | |
| [Normal]_Normal("Normal", 2D) = "bump" {} | |
| _Glossiness ("Smoothness", Range(0,1)) = 0.5 | |
| _Metallic ("Metallic", Range(0,1)) = 0.0 | |
| _ThicknessMin("ThicknessMin", float) = 250 | |
| _ThicknessMax("ThicknessMax", float) = 400 |
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; | |
| using System.Collections.Generic; | |
| // delegate used by task queue/manager system | |
| public delegate bool UntilTaskPredicate(float elapsedTime); | |
| public class TaskQueue | |
| { | |
| // manage each step of the task queue |