Skip to content

Instantly share code, notes, and snippets.

View valryon's full-sized avatar
🤘

Damien Mayance valryon

🤘
View GitHub Profile
@valryon
valryon / Water2D.shader
Created October 10, 2016 15:27
Colored Water2D shader with a normal map for Unity
Shader "Custom/Water2D Surface" {
Properties {
_Color("Color", Color) = (1,1,1,1)
_MainTex ("Normalmap", 2D) = "bump" {}
_Magnitude("Magnitude", Range(0,1)) = 0.05
}
Category {
// We must be transparent, so other objects are drawn before this one.
@valryon
valryon / Extruder.cs
Created November 18, 2016 13:25
Extrude a 2D sprite to a mesh from a Polygon Collider in Unity3D
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// <summary>
///
/// </summary>
/// <remarks>Source: https://forum.unity3d.com/threads/trying-extrude-a-2d-polygon-to-create-a-mesh.102629/ </remarks>
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer), typeof(PolygonCollider2D))]
public class ExtrudeSprite : MonoBehaviour
@valryon
valryon / CameraShaker.cs
Created November 20, 2017 11:25
Simple camera shaker for Unity3D
using UnityEngine;
/// <summary>
/// Shake shake shake the screen!
/// </summary>
public class CameraShaker : MonoBehaviour
{
#region Members
private static CameraShaker instance;
private Transform camTransform;