Skip to content

Instantly share code, notes, and snippets.

View Raisins's full-sized avatar

Francis Cleary Raisins

  • Kingdom of Portland
  • 03:24 (UTC -07:00)
  • X @Raisins
View GitHub Profile
@staggartcreations
staggartcreations / HeightmapToMesh.cs
Created June 27, 2019 18:05
Convert heightmap to mesh
// Staggart Creations
// http://staggart.xyz
using UnityEngine;
[ExecuteInEditMode]
public class HeightmapToMesh : MonoBehaviour
{
public MeshFilter meshFilter;
public Texture2D heightmap;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
public float speedX;
public float accelX;
public float decelX;
public float gravity;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BoxMover : MonoBehaviour
{
public enum Slide
{
None,
Perpendicular,
@rstecca
rstecca / DebugTriangleNormals.cs
Last active May 4, 2021 09:28
Unity Debug Mesh Normals in Editor
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class DebugTriangleNormals : MonoBehaviour {
#if UNITY_EDITOR
List<Vector3> trisCenters;
@phosphoer
phosphoer / PostFXBlend.cs
Created March 28, 2018 18:44
Unity PostFX Profile Blending
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
using System.Collections;
public abstract class PostFXBlend : MonoBehaviour
{
public float FadeInTime = 1.0f;
public float FadeOutTime = 1.0f;
public float BlendWeightDebug;
@sg-s
sg-s / automatic-version-numbers.md
Last active March 3, 2024 10:07
Automatic version numbers of your git repository using git hooks

Put this in a file called pre-commit in .git/hooks/

#!/bin/sh
# To enable this hook, rename this file to "pre-commit".

git rev-list --count master > build_number
git add build_number
@phosphoer
phosphoer / GravityItem.cs
Last active May 27, 2023 19:54
Mario Galaxy Gravity for Unity
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
using UnityEngine;
using System.Collections;
// based on http://unitytipsandtricks.blogspot.com/2013/05/camera-shake.html
public class PerlinShake : MonoBehaviour
{
public float duration = 2f;
public float speed = 20f;
public float magnitude = 2f;
public AnimationCurve damper = new AnimationCurve(new Keyframe(0f, 1f), new Keyframe(0.9f, .33f, -2f, -2f), new Keyframe(1f, 0f, -5.65f, -5.65f));
#include "keymap_common.h"
/*
Shane's Planck Layout
http://www.keyboard-layout-editor.com/#/layouts/015d9011102619d7695c86ffe57cf441
*/
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP( /* Base */
TAB, Q, W, E, R, T, Y, U, I, O, P, MINS,
@KeyMaster-
KeyMaster- / spriteGlitch.shader
Last active May 20, 2024 14:58
A glitch effect shader for Sprites in Unity3D
//Copyright (c) 2014 Tilman Schmidt (@KeyMaster_)
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in