Instantly share code, notes, and snippets.

TurboHermit turbohermit

View GitHub Profile
View CameraClipTessellation.shader
Shader "Surface/Standard With Camera Clipping Tesselate" {
Properties {
_Tess ("Tessellation", Range(1,32)) = 4
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
_ClipThreshold("Clip Threshold", Float) = 1
_EdgeSize("Clip Edge Size", Float) = 1
_ClipColor("Clip Edge Color", Color) = (1,1,1,1)
View TrippleAdditiveDepth.shader
Shader "Three Texture Additive Soft Particle"
{
Properties
{
_TintColor("Tint Color", Color) = (0.5, 0.5, 0.5, 0.5)
_MainTex("Main Texture", 2D) = "white" {}
_SecondTex("Second Texture", 2D) = "white" {}
_ThirdTex("Third Texture", 2D) = "white" {}
_PanSpeed("Panning Speed", Vector) = (0,0,0,0)
_ThirdPan("Third Texture Pan", Float) = 0
View DialogueContainer.cs
[System.Serializable]
public class DialogueContainer : ScriptableObject
{
//Unique ID used as ref
public string ID;
//All variants of the text to display
public string contentText;
//The response options
public List<DialogueOptionContainer> responseOptions;
//The tags this dialogue uses
View GridManager.cs
public class GridManager : MonoBehaviour
{
public int radiusInRingAmount = 5;
public GameObject tilePrefab;
public static List<Vector3> cubeCoordinates = new List<Vector3>();
void Awake()
{
GenerateGrid();
}
@turbohermit
turbohermit / Cue.cs
Last active Jun 29, 2018
An inheritance-based messaging system for executing behaviour based on enumerations. The system is designed to improve upon Unity's component based systems, but foregoes the need for reflection on every behaviour you're trying to send messages to, saving tons of performance on projects with a lot of behaviours that interact with each other..
View Cue.cs
//Add whatever keywords are relevant to your project here.
public enum Cue
{
None,
Spawn,
Destroy,
Stop,
Pause,
Start,
Refresh
@turbohermit
turbohermit / SplineMesh.cs
Last active Jan 3, 2018
Creates a flat mesh based on a spline, useful for roads.
View SplineMesh.cs
//Produces a flat mesh based on a spline, useful for creating roads.
public class SplineMesh : MonoBehaviour
{
public static Mesh CreateSplineMesh(Vector3[] splinePoints, float[] widthPoints)
{
Mesh mesh = new Mesh();
Vector3[] vertices = new Vector3[splinePoints.Length * 2];
//Create new vertices at both sides of the spline point
for (int i = 0; i < splinePoints.Length; i++)
@turbohermit
turbohermit / WaveMesh.cs
Last active Sep 7, 2017
A simple vertex displacement script that uses sine on two axis to emulate a wave-like behaviour.
View WaveMesh.cs
//A simple vertex displacement script that uses sine on two axis to emulate a wave-like behaviour.
public class WaveMesh : MonoBehaviour
{
public MeshFilter meshFilter;
public float amplitude = 0.5f;
public float xLength = 0.5f;
public float zLength = 0.5f;
public float speed = 1.0f;
//Only affect the vertices above this heigth in local space
public float affectedVerticesHeightTreshold;
@turbohermit
turbohermit / Vertex-GradientTransparent.shader
Last active Sep 1, 2017
Vertex gradient shader that interpolates between 2 colours based on every vertex Y position.
View Vertex-GradientTransparent.shader
Shader "Vertex/Gradient" {
Properties {
_TopColor("Top Color", Color) = (1,1,1,1)
_BottomColor ("Bottom Color", Color) = (1,1,1,1)
_Scale ("Scale", Float) = 1
_Offset ("Offset", Float) = 1
}
SubShader {
Tags {"Queue"="Transparent" "RenderType"="Transparent" "LightMode"="ForwardBase"}