Skip to content

Instantly share code, notes, and snippets.

View turbohermit's full-sized avatar

TurboHermit turbohermit

View GitHub Profile
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)
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
[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
public class GridManager : MonoBehaviour
{
public int radiusInRingAmount = 5;
public GameObject tilePrefab;
public static List<Vector3> cubeCoordinates = new List<Vector3>();
void Awake()
{
GenerateGrid();
}
@turbohermit
turbohermit / SplineMesh.cs
Last active January 3, 2018 17:22
Creates a flat mesh based on a spline, useful for roads.
//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 September 7, 2017 13:16
A simple vertex displacement script that uses sine on two axis to emulate a wave-like behaviour.
//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 September 1, 2017 10:23
Vertex gradient shader that interpolates between 2 colours based on every vertex Y position.
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"}