Skip to content

Instantly share code, notes, and snippets.

Avatar
🤘

Damien Mayance valryon

🤘
View GitHub Profile
@valryon
valryon / Timer.cs
Last active Jan 17, 2021
Unity simple Timer with co-routine
View Timer.cs
// 2014 - Pixelnest Studio
using System;
using System.Collections;
using UnityEngine;
/// <summary>
/// Ready to use timers for coroutines
/// </summary>
/// <summary>
/// Ready to use timers for coroutines
@valryon
valryon / CheatCode.cs
Created Apr 1, 2014
Unity cheat code handler
View CheatCode.cs
// Copyright © 2014 Pixelnest Studio
// This file is subject to the terms and conditions defined in
// file 'LICENSE.md', which is part of this source code package.
using UnityEngine;
namespace Pixelnest
{
/// <summary>
/// Trigger an event is a cheat code is recognized
/// </summary>
@valryon
valryon / WaterLine.cs
Last active Apr 25, 2020
2d Water Line in Unity. With realtime mesh construction and deformation. Just a start, no physics. Thanks to http://forum.unity3d.com/threads/141925-2d-Water and http://games.deozaan.com/unity/MeshTutorial.pdf
View WaterLine.cs
// Author: Damien Mayance (http://dmayance.com)
// 2013 - Pixelnest Studio (http://pixelnest.io)
//
// This script simulates a simple 2d water line behavior, like you see in many 2d games.
// See http://dmayance.com/water-line-2d-unity/ for further explanations.
//
// Usage:
// - Attach it to an object
// - Then fill the "Material" parameter
// - Start the game (here it is only visible at runtime)
@valryon
valryon / ScrollingScript.cs
Last active Oct 19, 2020
Multi directionnal infinite scrolling script.This is related to the tutorial http://pixelnest.io/tutorials/2d-game-unity/parallax-scrolling/
View ScrollingScript.cs
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
/// <summary>
/// Parallax scrolling script that should be assigned to a layer
///
/// This is related to the tutorial http://pixelnest.io/tutorials/2d-game-unity/parallax-scrolling/
///
@valryon
valryon / DecalPainter.cs
Last active May 4, 2020
An improved version of my unity script that can splash a decal prefab (or anything else) in random direction from a point using raycasting.
View DecalPainter.cs
// Author: Damien Mayance (http://dmayance.com)
// 2013 - Pixelnest Studio (http://pixelnest.io)
//
// This script paints decals on surfaces it hits from a point.
// See http://dmayance.com/2013-10-09-unity-paint-part-2/ for further explanations.
//
// Usage:
// - Attach it to an unique object that won't be deleted of your choice. There should be only one instance of this script.
// - Then fill the "PaintDecalPrefabs" list with your decals prefabs.
// - Finally, just call DecalPainter.Instance.Paint from another script to paint!
@valryon
valryon / PainterScript.cs
Created Oct 7, 2013
A unity script that can splash a decal prefab (or anything else) in radom direction from a point using raycasting.
View PainterScript.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// Generate paint decals
/// </summary>
public class PainterScript : MonoBehaviour
{
public static PainterScript Instance;
@valryon
valryon / .gitignore
Last active Jan 10, 2017
Unity .gitignore
View .gitignore
# =============== #
# Unity generated #
# =============== #
Temp/
Obj/
UnityGenerated/
/Library/
# ===================================== #
# Visual Studio / MonoDevelop generated #
@valryon
valryon / sitemap.xml
Created Apr 8, 2013
Simple sitemap.xml for Jekyll
View sitemap.xml
---
layout: nil
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.sitemaps.org/schemas/sitemap-image/1.1" xmlns:video="http://www.sitemaps.org/schemas/sitemap-video/1.1">
{% for post in site.posts %}
{% unless post.hide %}
<url>
<loc>{{ site.url }}{{ post.url }}</loc>
{% if post.lastmod %}
@valryon
valryon / EncryptionHelper.cs
Last active Dec 14, 2015
I think I found an issue between Monotouch (iOS) and .NET 4. Using an encryption algorithm I have differents outputs due to a default value set in .NET and not in MonoTouch.
View EncryptionHelper.cs
// This file is shared both with a MonoTouch iOS and ASP.NET MVC 3 + .NET 4 project.
// The result of Encrypt differs because of the default selected mode.
// See line 94 for information.
public static class EncryptionHelper
{
/// <summary>
/// Default key
/// </summary>