Skip to content

Instantly share code, notes, and snippets.

@belzecue
belzecue / MotionLogic.cs
Created July 21, 2018 16:29 — forked from josephbk117/MotionLogic.cs
Various motion exmaples with sin & cos
#define _Example4
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MotionLogic : MonoBehaviour
{
public float speed = 1.0f;
[Range(0.5f, 3.5f)]
@belzecue
belzecue / VoronoiNoise.shader
Created July 21, 2018 16:29 — forked from josephbk117/VoronoiNoise.shader
Voronoi shader in unity
Shader "BitShiftProductions/VoronoiMagic2"
{
Properties
{
}
SubShader
{
Tags { "RenderType" = "Opaque" }
@belzecue
belzecue / DirectionalColour.shader
Created July 21, 2018 16:30 — forked from josephbk117/DirectionalColour.shader
unity shader that shows texture based on the object's normal
Shader "BitShiftProgrammer/DirectionalColour"
{
Properties
{
_Tex1 ("Texture 1", 2D) = "white" {}
_Tex2("Texture 2", 2D) = "white"{}
_Tex3("Texture 3", 2D) = "white"{}
}
SubShader
{
@belzecue
belzecue / WhiteNoise.shader
Created July 21, 2018 16:30 — forked from josephbk117/WhiteNoise.shader
White noise ( grain filter ) shader in unity
Shader "BitShiftProductions/Noises"
{
Properties
{
_MainTex("Texture", 2D)="white"
_NoiseScale("Noise Scale",Float) = 5.0
_Strength("Noise Strength",Float) = 1.0
}
SubShader
{
@belzecue
belzecue / AnimatedFish.shader
Created July 21, 2018 16:31 — forked from josephbk117/AnimatedFish.shader
An animated fish shader written for use in unity
Shader "BitShiftProgrammer/AnimatedFish"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_EffectRadius("Wave Effect Radius",Range(0.0,1.0)) = 0.5
_WaveSpeed("Wave Speed", Range(0.0,100.0)) = 3.0
_WaveHeight("Wave Height", Range(0.0,30.0)) = 5.0
_WaveDensity("Wave Density", Range(0.0001,1.0)) = 0.007
_Yoffset("Y Offset",Float) = 0.0
@belzecue
belzecue / GenericsExample.cs
Created July 21, 2018 16:33 — forked from josephbk117/GenericsExample.cs
An exmple of generics in c#
using System;
using System.Collections;
using System.Collections.Generic;
public interface IUseMagic
{
void UseMagic();
}
public class MagicUser : IUseMagic
{
@belzecue
belzecue / AudioVisualizer.cs
Created July 21, 2018 16:33 — forked from josephbk117/AudioVisualizer.cs
Audio visualizer in unity with blend shapes
using UnityEngine;
[RequireComponent(typeof(SkinnedMeshRenderer))]
public class AudioVisualizer : MonoBehaviour
{
[Range(1.0f,4500.0f)]
public float multiplier;
public int minRange = 0;
public int maxRange = 64;
private SkinnedMeshRenderer skinnedMeshRenderer;
@belzecue
belzecue / JarvisMarchConvexHull.cs
Created July 21, 2018 16:34 — forked from josephbk117/JarvisMarchConvexHull.cs
Jarvis march convex hull unity c# script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class JarvisMarchConvexHull : MonoBehaviour
{
public Transform[] points;
[Range(0.05f,1.5f)]
public float size;
public bool drawIt;
@belzecue
belzecue / SurfaceImitator.cs
Created July 21, 2018 16:35 — forked from josephbk117/SurfaceImitator.cs
depth surface generated with the help of surface generator script
using UnityEngine;
public class SurfaceImitator : MonoBehaviour
{
public SurfaceGenerator reference;
public bool generateCollider = true;
private Mesh mesh;
private Vector3[] vertices;
@belzecue
belzecue / SurfaceGenerator.cs
Created July 21, 2018 16:35 — forked from josephbk117/SurfaceGenerator.cs
Code for generating 2d surfaces like in Alto's Adventure
using UnityEngine;
public class SurfaceGenerator : MonoBehaviour
{
public bool generateContinuously = false;
public bool generateCollider = false;
[Range(0.1f,50.0f)]
public float yScaling = 5.0f;
[Range(0.1f,20.0f)]
public float detailScaling = 1.0f;