Skip to content

Instantly share code, notes, and snippets.

View Eriard's full-sized avatar

Markus Lange Eriard

View GitHub Profile
@Fonserbc
Fonserbc / Easing.cs
Last active October 30, 2025 21:21
Compact and simple easing functions for Unity
using UnityEngine;
/*
* Most functions taken from Tween.js - Licensed under the MIT license
* at https://github.com/sole/tween.js
* Quadratic.Bezier by @fonserbc - Licensed under WTFPL license
*/
public delegate float EasingFunction(float k);
public class Easing
@unitycoder
unitycoder / RotateSpriteTowardsMouse.cs
Last active September 25, 2025 05:23
Rotate sprite towards mouse
// Rotate sprite/object towards mouse
// Reference: http://johnstejskal.com/wp/rotating-objects-and-sprites-in-unity3d-using-cs-c/
// https://forum.unity3d.com/threads/how-to-detect-angle-from-one-object-to-another-in-2d.477510/
// Usage: Attach this script to sprite, use Orthographic camera!
using UnityEngine;
using System.Collections;
public class RotateSpriteTowardsMouse : MonoBehaviour
{
Shader "Sprites/Cutout"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
_Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.5
}
/*
Tween for Unity by Alec Holowka
http://InfiniteAmmo.com - @infinite_ammo
*/
using UnityEngine;
using System.Collections;
public class TweenBase : MonoBehaviour
{
/*
SpriteAnimator for Unity by Alec Holowka
http://InfiniteAmmo.com - @infinite_ammo
*/
using UnityEngine;
using System.Collections;
public class SpriteAnimator : MonoBehaviour
{